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

ld: 1319 duplicate symbols for architecture x86_64 after upgrading to 0.60 from 0.59.9 #25484

Closed
roshangm1 opened this issue Jul 4, 2019 · 17 comments
Labels

Comments

@roshangm1
Copy link
Contributor

I upgraded the react native version to 0.60 from 0.59.9. I wasn't using any Pods when on 0.59.9. But after 0.60, I added Podfile with following content (as per rn-diff)

platform :ios, '9.0'
require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules'
target 'taxiApp' do
rn_maps_path = '../node_modules/react-native-maps'
  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-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'
  
  target 'taxiAppTests' do
    inherit! :search_paths
    # Pods for testing
  end
  use_native_modules!
end 

//this is for solving some issue with react-native-config and cocoapods
post_install do |installer|
    installer.pods_project.targets.each do |target|
      if target.name == 'react-native-config'
        phase = target.project.new(Xcodeproj::Project::Object::PBXShellScriptBuildPhase)
        phase.shell_script = "cd ../../"\
                             " && RNC_ROOT=./node_modules/react-native-config/"\
                             " && export SYMROOT=$RNC_ROOT/ios/ReactNativeConfig"\
                             " && export BUILD_DIR=$RNC_ROOT/ios/ReactNativeConfig"\
                             " && ruby $RNC_ROOT/ios/ReactNativeConfig/BuildDotenvConfig.ruby"
  
        target.build_phases << phase
        target.build_phases.move(phase,0)
      end
    end
  end

I did pod install which installed 4 extra pods (maybe as a part of auto linking):

react-native-config (0.11.7)
react-native-geolocation (1.4.2)
react-native-maps (0.24.2)
RNGestureHandler

After that, I opened Xcode and started building the app and I got this issue with duplicate symbols. A lot of pods/libraries are being installed (duplicate). For example:

I think this is a problem
Both jsi and React-jsi are being installed while building the project.

React Native version:

System:
    OS: macOS 10.14.5
    CPU: (4) x64 Intel(R) Core(TM) i5-7360U CPU @ 2.30GHz
    Memory: 89.96 MB / 8.00 GB
    Shell: 5.3 - /bin/zsh
  Binaries:
    Node: 11.9.0 - /usr/local/bin/node
    Yarn: 1.13.0 - /usr/local/bin/yarn
    npm: 6.5.0 - /usr/local/bin/npm
    Watchman: 4.9.0 - /usr/local/bin/watchman
  SDKs:
    iOS SDK:
      Platforms: iOS 12.2, macOS 10.14, tvOS 12.2, watchOS 5.2
    Android SDK:
      API Levels: 23, 25, 26, 27, 28
      Build Tools: 27.0.3, 28.0.3
      System Images: android-24 | Google APIs Intel x86 Atom, android-28 | Google APIs Intel x86 Atom
  IDEs:
    Android Studio: 3.4 AI-183.6156.11.34.5522156
    Xcode: 10.2.1/10E1001 - /usr/bin/xcodebuild
  npmPackages:
    react: 16.8.6 => 16.8.6
    react-native: 0.60.0 => 0.60.0
  npmGlobalPackages:
    react-native-cli: 2.0.1
    react-native-git-upgrade: 0.2.7

Steps To Reproduce

  1. Upgrade to RN-0.60
  2. Have packages which needs installing pods
  3. pod install
  4. Build the project from XCode

Describe what you expected to happen:
I expect it to not install duplicate pods/libraries and successful build.

@roshangm1 roshangm1 added the Bug label Jul 4, 2019
@roshangm1
Copy link
Contributor Author

Link Binary and Libraries in Build Phases looks like this.

image

@roshangm1
Copy link
Contributor Author

I actually removed all of these contents inside Link Binary With Libraries and the build was successful. But I don't understand what's going on in here.

@Kida007
Copy link
Contributor

Kida007 commented Jul 4, 2019

I think RN shifted to Pods , all native ios stuff is now handled by pods , Therefore you don't need those Linked Libraries.
react-native-community/upgrade-helper#47

I updated from 0.57.8 to 0.60.0 following RN Update Helper and my build still failing :(

@roshangm1
Copy link
Contributor Author

Closing this because I think removing these contents from Link Binary With Binaries is a required move.

@stefansukara
Copy link

Just remove everything from Build Phases/ Link Binary With Libraries , and it must work! 🤙🤘

@Psiiirus
Copy link

Psiiirus commented Jul 9, 2019

Just a little hint if you use PushNotifications you have to extend the Podfile on your own!
...took me a while to noticed this

@martindavid
Copy link

@Psiiirus Can you enlight us with this? Because I'm having the same issue with PushNotification as well after upgrade to 0.60.0

@Psiiirus
Copy link

@Psiiirus Can you enlight us with this? Because I'm having the same issue with PushNotification as well after upgrade to 0.60.0

i created a pull request to change the docs , i hope this can help you for now?
https://deploy-preview-1087--react-native.netlify.com/docs/next/pushnotificationios

@PavanKumar-sa
Copy link

@Psiiirus
Facing issue with PushNotificationIOS after upgrading to 0.60, can you let us know how RCTPushNotification is listed in pod file.

Below is the error details:

In file included from /../node_modules/react-native/Libraries/PushNotificationIOS/RCTPushNotificationManager.m:8:

/../node_modules/react-native/Libraries/PushNotificationIOS/RCTPushNotificationManager.h:8:9: fatal error: 'React/RCTEventEmitter.h' file not found

#import <React/RCTEventEmitter.h>
^~~~~~~~~~~~~~~~~~~~~~~~~

@martindavid
Did u get the fix for the PushNotification?

@Psiiirus
Copy link

@Psiiirus
Facing issue with PushNotificationIOS after upgrading to 0.60, can you let us know how RCTPushNotification is listed in pod file.

Below is the error details:

In file included from /../node_modules/react-native/Libraries/PushNotificationIOS/RCTPushNotificationManager.m:8:

/../node_modules/react-native/Libraries/PushNotificationIOS/RCTPushNotificationManager.h:8:9: fatal error: 'React/RCTEventEmitter.h' file not found

#import <React/RCTEventEmitter.h>
^~~~~~~~~~~~~~~~~~~~~~~~~

@martindavid
Did u get the fix for the PushNotification?

Not 100% whats your problem is, sorry....but one lession i learned...drop the whole node_modules folder and do a clean build :)

@OlegNovosad
Copy link

rm -rf Podfile.lock
pod deintegrate
pod install

Remove if something left in Link Binaries.

AWare added a commit to guardian/editions that referenced this issue Aug 10, 2019
AWare added a commit to guardian/editions that referenced this issue Aug 13, 2019
…?from=0.59.3&to=0.60.0

package updates

Unlink everything

add pods

This was causing a problem so is gone.

This was causing a problem so I removed it.

Install pods

fix typo

upgrades?

More upgrades

yarn lock

unlink

pods

fix config weirdness

facebook/react-native#25484

zo0r/react-native-push-notification#1147

zo0r/react-native-push-notification#1147

note on cache cleaning

remove crossword bunder from main shell

gradle.properties change needed in https://react-native-community.github.io/upgrade-helper/?from=0.59.3&to=0.60.4
not sure about keystor

fix build.gradle to .60 achetype

fix build.gradle

force use of correct rn types
@gudbrand3
Copy link

THANK YOU @ roshangm1 !!

This worked like a charm, took me forever to find this thread though. Had the same issue on react-native 0.60.5

@jhainaua
Copy link

I did this and the project builds; however, I'm now getting the following:

Screen Shot 2019-08-21 at 5 21 12 PM

Any idea what I did wrong/how to fix?

@erick4556
Copy link

Hi @Kida007 , how did you update to react-native 0.60 ? I have a few issues when I making that update

@Kida007
Copy link
Contributor

Kida007 commented Nov 1, 2019

Using update helper .

@zvone00
Copy link

zvone00 commented Nov 19, 2019

To make this work, I had to entirely remove content from Library folder, not just unlink dependencies.

@khuramdogar
Copy link

khuramdogar commented Jun 24, 2020

If you are using a Podfile you can also remove React-RCTPushNotification and add the following...

pod 'RNCPushNotificationIOS', :path => '../node_modules/@react-native-community/push-notification-ios'
because React-RCTPushNotification is from 'react-native' but push notifications has been moved to @react-native-community.

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