react-native-onesignal icon indicating copy to clipboard operation
react-native-onesignal copied to clipboard

symbol(s) not found for architecture x86_64

Open olliebrennan opened this issue 10 years ago • 25 comments

Hey,

I am running into an issue when importing this into a RN project (migrating from Parse!).

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

It looks very similar to https://github.com/geektimecoil/react-native-onesignal/issues/5 although different architecture.

I am pretty unfamiliar with ObjectiveC but happy to help where I can and will issue PR if I can be guided as required. Hopefully someone can help me along!

Thanks Ollie

olliebrennan avatar Apr 14 '16 12:04 olliebrennan

@olliebrennan did you manage to resolve this issue? I am looking through the commit for #5 to figure out what to do. I'm a JS dev, not an iOS dev, so am unfamiliar with the various settings.

jamiemchale avatar Apr 21 '16 13:04 jamiemchale

Maybe @jkasten2 can help here?

avishayil avatar Apr 24 '16 11:04 avishayil

@jamiemchale I did not. Had the same issue as you so left my app using Parse until a fix comes along. Happy to help if I can but as you said, I am also unfamiliar with the iOS language / settings.

olliebrennan avatar Apr 27 '16 23:04 olliebrennan

@olliebrennan @avishayil If you installed the OneSignal plugin with Cocoa pods it may not reference the OneSignal native framework to the main project. You can drop and drag OneSignal.framework from Finder to XCode which should fix the linker error. You may have to select "Copy items if needed" if it does not work without.

image

image

Lastly make sure you are using Xcode 7.0 or higher as older versions of Xcode will result in the exact same error here.

jkasten2 avatar Apr 28 '16 03:04 jkasten2

Thanks @jkasten2 I have a release going out in the next couple of days then will try this and report back.

Cheers

olliebrennan avatar Apr 30 '16 02:04 olliebrennan

+1 having a similar issue on OSX

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

I was missing OneSignal.framework. Tried dragging appname/node_modules/react-native-onesignal/ios/Frameworks/OneSignal.framework into XCode's Libraries. Still not working.

Tried appname/ios/Pods/OneSignal/iOS_SDK/Framework/OneSignal.framework as well, didn't work either.

@olliebrennan Did you manage to resolve the issue?

hyperh avatar May 10 '16 06:05 hyperh

I had the exact same issue as @olliebrennan, solved it by:

  1. drag the node_modules/react-native-onesignal/ios/Frameworks folder into RCTOneSignal.xcodeproj under XCode's left panel
  2. once in the left panel, drag the OneSignal.framework into Link Binary with Libraries

whollacsek avatar May 13 '16 12:05 whollacsek

Hey @hyperh @olliebrennan did you managed to solve this?

avishayil avatar May 24 '16 07:05 avishayil

@avishayil I was unable to solve this. I decided to go with apnagent to handle my APN stuff.

hyperh avatar May 24 '16 08:05 hyperh

If someone encounters the same error, please report. I'm closing this issue for now.

avishayil avatar May 26 '16 09:05 avishayil

@avishayil I have this problem. Tried following @whollacsek's instructions but I am still getting the same error in XCode.

screenshot 2016-06-03 15 40 31

chrissm79 avatar Jun 03 '16 22:06 chrissm79

Same problem as @chrissm79 and others

masterkrang avatar Jun 08 '16 19:06 masterkrang

I just got here and yes, same problem.

edo1493 avatar Jun 11 '16 13:06 edo1493

+1

avishayhajbi avatar Jun 16 '16 20:06 avishayhajbi

Looking into it. Any reproduce steps?

avishayil avatar Jun 17 '16 06:06 avishayil

I experienced this issue and was able to fix it by clicking and dragging ios/Pods/OneSignal/iOS_SDK/Framework/OneSignal.framework from Finder into the Frameworks folder of my XCode project.

chromakey avatar Jun 21 '16 13:06 chromakey

Same exact issue as @chrissm79

Edit: Solved by downloading the framework and linking it from the documented link rather than using the framework in the node_modules folder.

c-h- avatar Jul 01 '16 21:07 c-h-

You have the example project to reference and play with, please make sure you're following all the orders, no errors should occur. On Jul 2, 2016 12:37 AM, "Charles Hulcher" [email protected] wrote:

Same exact issue as @chrissm79 https://github.com/chrissm79

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/geektimecoil/react-native-onesignal/issues/18#issuecomment-230052711, or mute the thread https://github.com/notifications/unsubscribe/AAyekNTkU15t6IP4zvQzg06yXzUf0akHks5qRYiBgaJpZM4IHVBS .

avishayil avatar Jul 02 '16 07:07 avishayil

I also have this problem but don't know how to solve it

ld: warning: ignoring file /Users/apple/Desktop/Camera/XCTest.framework/XCTest.tbd, missing required architecture x86_64 in file /Users/apple/Desktop/Camera/XCTest.framework/XCTest.tbd (3 slices) Undefined symbols for architecture x86_64: "OBJC_CLASS$_XCTestCase", referenced from: OBJC_CLASS$__TtC6Camera11toucanTests in toucanTests.o "OBJC_METACLASS$_XCTestCase", referenced from: OBJC_METACLASS$__TtC6Camera11toucanTests in toucanTests.o ld: symbol(s) not found for architecture x86_64 clang: error: linker command failed with exit code 1 (use -v to see invocation)

LawanyaD avatar Dec 01 '16 04:12 LawanyaD

i'm on react-native 0.37 and here's how i was able to get this to work (i think the readmes/documentation are slightly behind react native).

  1. on a clean branch with none of the onesignal work...
  2. run npm install react-native-onesignal --save
  3. run react-native link
  4. for iOS follow the podfile instructions (be sure to follow the react native version note carefully)
  5. for iOS follow the code additions in the instructions
  6. for android follow the android instructions (most of the code should be there from the link command, but double check everything)
  7. for android be sure to use import com.geektime.reactnativeonesignal.ReactNativeOneSignalPackage; and NOT import com.geektime.rnonesignal.ReactNativeOneSignalPackage; (some old documentation had the rnonesignal and that's since been updated)
  8. then complete config and setup and all files
  9. hopefully that does the trick for you...please reply if you have any issues as i spent some time on both android and iOS over a few branches to get this to work.

YMMV if you are using something lower than v0.37 of RN. good luck.

jakeatwork avatar Dec 02 '16 22:12 jakeatwork