React-native-onesignal: 101 duplicate symbols for architecture x86_64

Created on 7 Mar 2017  ·  16Comments  ·  Source: OneSignal/react-native-onesignal

Linker command failed with exit code 1

Most helpful comment

For both two, are you using CocoaPods ?
Cause actually, the initial error occurres when you are using Cocoapods, since for the 3.0.3 version of react-native-onesignal, they have stopped using cocoa pods.
You were getting the duplicate error because you had cocoapods version of onesignal + 3.0.3 of react native onesignal that now integrates same Sdk files (they are duplicated).
Either you stay on version 3.0.3 without cocoapods, or you go to 3.0.2 using cocoapods

For me, understanding this allowed me to solve the same problems...

All 16 comments

In your package.json, copy here the line concerning react-native-onesignal please

I'm having a similar problem:

23 duplicate symbols for architecture arm64

Package.json:

"react-native-onesignal": "^3.0.3",

Please, delete your npm-modules folder.
Then, change in your package.json to put "react-native-onesignal": "3.0.2",
Run npm install
And try to build again on Xcode. Let me know if it changes something !

Followed your advice, and now I'm getting:

Undefined symbols for architecture arm64:
"_OBJC_CLASS_$_RCTOneSignal", referenced from:
objc-class-ref in AppDelegate.o
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

After re-running react-native link react-native-onesignal, I'm getting a ton of errors:

image

@Pampounet

Here is my package.json
"react": "15.4.2",
"react-native": "0.40.0",
"react-native-android-location-services-dialog-box": "^1.2.0",
"react-native-checkbox": "^1.1.0",
"react-native-code-push": "^1.17.0-beta",
"react-native-country-picker-modal": "^0.2.10",
"react-native-drawer": "^2.3.0",
"react-native-easy-grid": "0.1.8",
"react-native-fbsdk": "^0.5.0",
"react-native-keyboard-aware-scroll-view": "0.2.7",
"react-native-maps": "^0.13.0",
"react-native-modalbox": "^1.3.9",
"react-native-onesignal": "^3.0.3".

For both two, are you using CocoaPods ?
Cause actually, the initial error occurres when you are using Cocoapods, since for the 3.0.3 version of react-native-onesignal, they have stopped using cocoa pods.
You were getting the duplicate error because you had cocoapods version of onesignal + 3.0.3 of react native onesignal that now integrates same Sdk files (they are duplicated).
Either you stay on version 3.0.3 without cocoapods, or you go to 3.0.2 using cocoapods

For me, understanding this allowed me to solve the same problems...

@superquest what you can do is install oneSignal using pods then obtain oneSignal framework file . Then delete pods and manually link the onesignal framework to your project .along with libonesignal . that won't show any issue . I have done in the same way .But havn't tested it for notification in mobile .Once i will do that .I will update here .

Tried downgrading to 3.0.2, and now seeing same as @superquest, screenshot.

Going to try @GeekRishabh latest now...

Edit: Still not got it working, will inform when/if so... 😬

Got it working! Here's what we did:

  1. Removed react-native-onesignal from dependencies
  2. Deleted the apps node_modules folder.
  3. Installed and ran cocoapods-deintegrate on the project. (This may not apply to all; however in our case, the only reason we had pods in this project was for onesignal).
  4. Ran through the installation process again, making sure to update any imports to <X> (we were updating from around v0.20 of rn to 0.42 😅 )
  5. Cleaned project, quit/relaunched xCode.
  6. ????
  7. PROFIT!!!

@Pampounet - your solution worked for me.

I have other pods installed, so here's what I did to remove OneSignal pod cleanly:

  1. sudo gem install cocoapods-deintegrate
  2. sudo gem install cocoapods-clean
  3. from ios directory inside project, run pod deintegrate
  4. pod clean
  5. delete the line pod 'OneSignal' in your podfile
  6. run pod install
  7. assuming you have followed all of the other installation and config directions in the latest version of OneSignal (3.0.3 for me), then running build again should work and you will have kept your other existing pods (slightly different situation then @breadadams)

As @Pampounet noted going to 3.0.3 requires you to remove OneSignal from Cocoapods as well as follow the new iOS setup instructions.
https://github.com/geektimecoil/react-native-onesignal#ios-installation

@GeekRishabh @avishayil I think we can close this issue now.

The Running Example project part of README.md does not mention this part, wasted some hours on it. Would it help to also get the documentation on how to run it updated?

Hi there,

I am experiencing this same problem

ld: 233 duplicate symbols for architecture x86_64

I was compiling with 3.0.2 and moved on to the last 3.2.3, getting rid of cocoapods as explained in this thread. I double checked every pod related file and they are all gone. Basically i get the following for several files

duplicate symbol _OBJC_METACLASS_$_OSRequestSubmitNotificationOpened in: /[...]/ios/OneSignal.framework/OneSignal(Requests.o) /[...]/Library/Developer/Xcode/DerivedData/[AppName]-fmxhrnwitpecshtmi/Build/Products/Debug-iphonesimulator/libRCTOneSignal.a(Requests.o)

I also tried to remove everything from the Library/... but the error keeps showing up.

Thanx in advance for any help

@grafosecondo this does mean that somehow the native OneSignal SDK is getting duplicated in your project. I would suggest running pod deintegrate, then follow the current setup guide to install OneSignal through npm (after linking you should see an RCTOneSignal Xcode subproject).

Somehow, OneSignal.framework is still in your project and it’s causing this issue.

@Nightsd01

Somehow, OneSignal.framework is still in your project and it’s causing this issue.

this saved my day, thank you!

Was this page helpful?
0 / 5 - 0 ratings