joltup / react-native-threads

Create new JS processes for CPU intensive work
MIT License
755 stars 141 forks source link

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

Open RustyTheBoyRobot opened 1 year ago

RustyTheBoyRobot commented 1 year ago
  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 commented 1 year ago

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 commented 1 year ago

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 commented 1 year ago

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