Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RN 69 is no longer auto-linking this module on iOS due to pod issues #154

Open
RustyTheBoyRobot opened this issue Aug 22, 2023 · 3 comments
Labels

Comments

@RustyTheBoyRobot
Copy link

  1. Run pod install on a RN 69+ app that uses react-native-threads. Look at the output for the part that says "Auto-linking React Native modules for target ______: ". Notice that RNThread is no longer listed
  2. Open your app in XCode. In Pods > Development Pods, RNThread is not listed.
  3. Run your app. The ThreadManager native module will be null
@RustyTheBoyRobot
Copy link
Author

RustyTheBoyRobot commented Aug 22, 2023

I think the root cause is that RN 69 is now looking for a *.podspec file at the root of the project, rather than in the iOS directory. You can manually fix this in your app by using patch-package to move the RNThread.podspec file to the root and changing the file paths accordingly.

require 'json'

package = JSON.parse(File.read(File.join(__dir__, './package.json')))

Pod::Spec.new do |s|
  s.name           = "RNThread"
  s.version        = package['version']
  s.summary        = "React native threads"
  s.description    = "React native threads"
  s.license        = package['license']
  s.author         = package['author']
  s.homepage       = "https://github.com/joltup/RNThread.git"
  s.source       = { :git => "https://github.com/joltup/RNThread.git", :tag => s.version }
  s.source_files  = "ios/**/*.{h,m}"
  s.platform      = :ios, "7.0"
  s.tvos.deployment_target = '10.0'

  s.dependency 'React'
end

@ThalesBMC
Copy link

I think the root cause is that RN 69 is now looking for a *.podspec file at the root of the project, rather than in the iOS directory. You can manually fix this in your app by using patch-package to move the RNThread.podspec file to the root and changing the file paths accordingly.

require 'json'

package = JSON.parse(File.read(File.join(__dir__, './package.json')))

Pod::Spec.new do |s|
  s.name           = "RNThread"
  s.version        = package['version']
  s.summary        = "React native threads"
  s.description    = "React native threads"
  s.license        = package['license']
  s.author         = package['author']
  s.homepage       = "https://github.com/joltup/RNThread.git"
  s.source       = { :git => "https://github.com/joltup/RNThread.git", :tag => s.version }
  s.source_files  = "ios/**/*.{h,m}"
  s.platform      = :ios, "7.0"
  s.tvos.deployment_target = '10.0'

  s.dependency 'React'
end

This worked for me!

@ThalesBMC
Copy link

@RustyTheBoyRobot Did you tried to update RN to 70?
I got stuck with react-native-threads on 0.70 and stopped updating.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants