OneSignal / react-native-onesignal

React Native Library for OneSignal Push Notifications Service
Other
1.57k stars 374 forks source link

objc-class-ref in libRCTOneSignal.a(RCTOneSignalExtensionService.o) #368

Closed Amurmurmur closed 6 years ago

Amurmurmur commented 6 years ago

Upgraded to react-native-onesignal 3.0.8 started to get this error on iOS

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

It looks like this is due to selecting the simulator as your run target (not a real iOS device which is x86_64)

Since push notifications are not available in simulator, onesignal push notifications wonโ€™t work. However that should not stop you from running the simulator entirely, since you should be able to test the rest of your application in the simulator.

Sorry about this issue. I will go ahead and fix this shortly, thank you for creating the issue @Amurmurmur

Amurmurmur commented 6 years ago

@Nightsd01 Thank you very much for such a quick response! Im looking forward for the coming updates ๐Ÿ‘

ujwal-setlur commented 6 years ago

Ahh, I am running into this too. Simulator build fails. Device build is fine. I will stick with 3.0.7 until this is fixed.

Nightsd01 commented 6 years ago

This issue has been addressed in #370 , thank you for reporting it!

digitaldavenyc commented 6 years ago

@Nightsd01 I am getting this issue building to a real device (iPhone X). I have been trying to get this to build for a few hours with no luck. I installed the repo directly from the master branch. Still no dice. Would appreciate any help.

Undefined symbols for architecture arm64:
  "_OBJC_CLASS_$_RCTOneSignal", referenced from:
      objc-class-ref in AppDelegate.o
  "_kOSSettingsKeyAutoPrompt", referenced from:
      -[AppDelegate application:didFinishLaunchingWithOptions:] 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)
digitaldavenyc commented 6 years ago

@Nightsd01 nvm I needed to re-import the xcode.project for the repo and add libRCTOneSignal.a to Linked Libraries again... Build is working on native device.

mrharel commented 6 years ago

@digitaldavenyc what do you mean you re-import the xcode.project? i am having the same issue, and not sure what to do

screen shot 2018-05-06 at 22 10 00
waleedarshad commented 6 years ago

yarn clear work for me.

simmatrix commented 6 years ago

For my case, I remove pod 'OneSignal' ... from my Podfile, because my Podfile already has pod 'react-native-onesignal', :path => '../node_modules/react-native-onesignal'. Then I removed the ios/Pods folder, do a fresh pod install, clean and build in XCode.

DanielTorresV commented 6 years ago

@mrharel I have the same issue

did you know how to solve it?

davidgruebl commented 5 years ago

In case anyone else runs into this: I've faced the same error when I did react-native link react-native-onesignal When i did the "Add Notification Service Extension" part I couldn't find the libRCTOneSignal.a file and fixed it by doing this: https://github.com/geektimecoil/react-native-onesignal/issues/604#issuecomment-413483935 Then I wrongly followed the "With Cocoapods" path (as I do have Cocoapods setup) although I had manually linked the library. Once I sticked to the "Without Cocoapods" path everything worked smoothly. Notice the difference in the filenames NotificationService.m (will be there if cocoapods isn't used) and NotificationServiceExtension.m (which will be there if it is installed via Cocoapods) Due to the error with the missing libRCTOneSignal.a file only the path without Cocoapods worked for me.

brycepavey commented 5 years ago

@davidgruebl saviour ๐Ÿ™Œ๐Ÿผ

diogomgbrito commented 5 years ago

@davidgruebl Saviour once gain ๐Ÿ™Œ๐Ÿผ

faisal3413 commented 5 years ago

I solved by linkinglibRCTOneSignal.a in one signal target.

image

killderycoelho commented 4 years ago

I solved by linking Coregraphcs.framework and webkit.framework Captura de Tela 2020-05-13 aฬ€s 09 29 01