Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

About 100 error in Xcode, Undefined symbols for architecture x86_64 :upgraded react-native from 0.59.1 to 0.60.5

I've been trying to upgrade my project and use cocoapods for ios, Whenever i build from xcode it gives me 100 error related to swift, - My project does not depends on swift - Upgraded all packages

Please find screenshot for error

PackageList Screenshot!

Xcode Error Screenshot!

Xcode Error Screenshot1!

Xcode Error Screenshot2!

I've followed below link for package upgradation react-native-community link!

Same error was found flutter! - didn't try this

# platform :ios, '9.0'

require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules'


target 'test' do
  # Uncomment the next line if you're using Swift or would like to use dynamic frameworks
  # use_frameworks!

  # Pods for test
  # Your 'node_modules' directory is probably in the root of your project,
  # but if not, adjust the `:path` accordingly
  pod 'React', :path => '../node_modules/react-native/'
  pod 'React-Core', :path => '../node_modules/react-native/React'
  pod 'React-DevSupport', :path => '../node_modules/react-native/React'
  pod 'React-fishhook', :path => '../node_modules/react-native/Libraries/fishhook'
  pod 'React-RCTActionSheet', :path => '../node_modules/react-native/Libraries/ActionSheetIOS'
  pod 'React-RCTPushNotification', :path => '../node_modules/react-native/Libraries/PushNotificationIOS'
  pod 'React-RCTAnimation', :path => '../node_modules/react-native/Libraries/NativeAnimation'
  pod 'React-RCTBlob', :path => '../node_modules/react-native/Libraries/Blob'
  pod 'React-RCTImage', :path => '../node_modules/react-native/Libraries/Image'
  pod 'React-RCTLinking', :path => '../node_modules/react-native/Libraries/LinkingIOS'
  pod 'React-RCTNetwork', :path => '../node_modules/react-native/Libraries/Network'
  pod 'React-RCTSettings', :path => '../node_modules/react-native/Libraries/Settings'
  pod 'React-RCTText', :path => '../node_modules/react-native/Libraries/Text'
  pod 'React-RCTVibration', :path => '../node_modules/react-native/Libraries/Vibration'
  pod 'React-RCTWebSocket', :path => '../node_modules/react-native/Libraries/WebSocket'

  pod 'React-cxxreact', :path => '../node_modules/react-native/ReactCommon/cxxreact'
  pod 'React-jsi', :path => '../node_modules/react-native/ReactCommon/jsi'
  pod 'React-jsiexecutor', :path => '../node_modules/react-native/ReactCommon/jsiexecutor'
  pod 'React-jsinspector', :path => '../node_modules/react-native/ReactCommon/jsinspector'
  pod 'yoga', :path => '../node_modules/react-native/ReactCommon/yoga'

  pod 'DoubleConversion', :podspec =>   '../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec'
  pod 'glog', :podspec => '../node_modules/react-native/third-party-podspecs/glog.podspec'
  pod 'Folly', :podspec => '../node_modules/react-native/third-party-podspecs/Folly.podspec'

  pod 'react-native-print', :path => '../node_modules/react-native-print'
  pod 'react-native-webview', :path => '../node_modules/react-native-webview'
  pod 'RNImageCropPicker', :path => '../node_modules/react-native-image-crop-picker'
  pod 'react-native-sqlite-storage', :path => '../node_modules/react-native-sqlite-storage'
  pod 'RNCAsyncStorage', :path => '../node_modules/@react-native-community/async-storage'
  pod 'react-native-netinfo', :path => '../node_modules/@react-native-community/netinfo'
  pod 'react-native-contacts', :path => '../node_modules/react-native-contacts'
  pod 'RNFS', :path => '../node_modules/react-native-fs'
  pod 'RNGestureHandler', :path => '../node_modules/react-native-gesture-handler'
  pod 'react-native-html-to-pdf', :path => '../node_modules/react-native-html-to-pdf'
  pod 'react-native-image-resizer', :path => '../node_modules/react-native-image-resizer'
  pod 'RNShare', :path => '../node_modules/react-native-share'
  pod 'react-native-splash-screen', :path => '../node_modules/react-native-splash-screen'
  pod 'RNSVG', :path => '../node_modules/react-native-svg'
  pod 'ReactNativePermissions', :path => '../node_modules/react-native-permissions'
  pod 'lottie-react-native', :path => '../node_modules/lottie-react-native'
  pod 'lottie-ios', :path => '../node_modules/lottie-ios'

  pod 'Firebase/Core', '~> 6.3.0'

  #pod 'OneSignal', '>= 2.9.3', '< 3.0'


  # Required by RNFirebase
  pod 'Firebase/Core', '~> 6.3.0'

  #target 'OneSignalNotificationServiceExtension' do
  #  pod 'OneSignal', '>= 2.6.2', '< 3.0'
  #end

  post_install do |installer|
    installer.pods_project.targets.each do |target|
      target.build_configurations.each do |config|
        config.build_settings['APPLICATION_EXTENSION_API_ONLY'] = 'No'
      end
    end
  end

  use_native_modules!
end

target 'test-tvOSTests' do
  inherit! :search_paths
  # Pods for testing
end

target 'testTests' do
  inherit! :search_paths
  # Pods for testing
end

target 'test-tvOS' do
  # Uncomment the next line if you're using Swift or would like to use dynamic frameworks
  # use_frameworks!

end```


Expecting it should have been worked easily
like image 533
Aquafreax Avatar asked Sep 12 '19 09:09

Aquafreax


3 Answers

Try this:

  1. Open ios/YourAppName.xcodeproj in Xcode
  2. Right-click on Your App Name in the Project Navigator on the left, and click New File…
  3. Create a single empty Swift file to the project (make sure that Your App Name target is selected when adding)
  4. When Xcode asks, press Create Bridging Header and do not remove Swift file then. re-run your build.

This should fix the problem

Found on github: https://github.com/mxcl/PromiseKit/issues/1059#issuecomment-493925940

like image 119
Viorel Andrei Chis Avatar answered Oct 17 '22 17:10

Viorel Andrei Chis


This issue can happen because of Xcode 12. I have created a script to fix the issue. You can find it here: https://gist.github.com/HosseinRashno/4786b289356ad9840b6c087ce8191fe4

Here you can find about the reason of the issue: https://github.com/facebook/react-native/issues/29633#issuecomment-694187116

The issue is that all the podspecs of these libraries that fail to link depend on the React pod, which is in fact really only an umbrella dependency for pure JS applications to depend on, whereas the native APIs that these libraries rely on actually reside in the React-Core pod.

This means that they technically were always incorrect—conceptually one should always explicitly depend on the lib that provides the APIs you rely on, rather than relying on transitive dependencies—but it seems like in previous Xcode versions the build system worked differently and having the transitive dependencies around just happened to work 🤷‍♂️

The correct fix going forward is for all these libs to update their dependency from React to React-Core:

Remove: s.dependency 'React'
Add: s.dependency 'React-Core'

like image 23
Hossein Rashno Avatar answered Oct 17 '22 17:10

Hossein Rashno


Please follow these steps:

  1. check the app developer id is logged in
  2. clean your build for your react native following steps: How can I clean my react-native project to back it up?
  3. close your Xcode
  4. Open your project from xworkspace
like image 1
Jihad Kahil Avatar answered Oct 17 '22 17:10

Jihad Kahil