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

React-native 0.60 -lPods-OneSignalNotificationExtension not found #838

Closed
jamesone opened this issue Sep 2, 2019 · 23 comments
Closed

React-native 0.60 -lPods-OneSignalNotificationExtension not found #838

jamesone opened this issue Sep 2, 2019 · 23 comments

Comments

@jamesone
Copy link

jamesone commented Sep 2, 2019

Description:

I've upgraded to React-native 0.60 and have followed the onesignal installation steps as shown here: https://documentation.onesignal.com/docs/react-native-sdk-setup

When I goto run the xcode application, I get an error relating to the OnesignalNotificationExtension.
Error: ld: library not found for -lPods-OneSignalNotificationServiceExtension

The OneSignalNotificationServiceExtension target has the following settings:

  • Header search paths: "${PODS_ROOT}/Headers/Public/react-native-onesignal"
  • Framework search paths: "${PODS_ROOT}/OneSignal/iOS_SDK/OneSignalSDK/Framework"

Environment

  • react-native-onesignal version: 3.3.2
  • react-native: 0.60.5

Steps to Reproduce Issue:

  1. Followed the RN setup: https://documentation.onesignal.com/docs/react-native-sdk-setup
  2. Run xcode project
  3. Expect to see: ld: library not found for -lPods-OneSignalNotificationServiceExtension
@rgomezp
Copy link
Contributor

rgomezp commented Sep 11, 2019

Howdy,
We released a new version yesterday. Can you please update and try again? Also try clearing your DerivedData folder located at /Users//Library/Developer/Xcode/DerivedData

Last thing to try is pod update from your ios directory

@andreymyssak
Copy link

@jamesone did you solve this problem? The answer from @rgomezp does not help.
 

@mtannerfors
Copy link

mtannerfors commented Sep 18, 2019

@rgomezp none of the above suggestions worked, using the latest release 3.4.1. Could do with some attention on this issue. Forced to remove OneSignalNotificationExtension until resolved, happy to try other suggestions/releases.

@rizwanatta
Copy link

+1 following !

@rgomezp
Copy link
Contributor

rgomezp commented Sep 19, 2019

Howdy,
Please try running pod deintegrate && pod install from the ios directory in your project

@anniewey
Copy link

anniewey commented Oct 1, 2019

Above suggestions are not working. Already updated to latest release v3.4.1, clean derived data, clean pods and reinstall but still getting error:

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

Podfile.lock

  - react-native-onesignal (3.4.1):
    - OneSignal (= 2.11.0)
    - React (< 1.0.0, >= 0.13.0)

UPDATE:
My bad. Turns out I need to replace the NotificationService.m contents with the latest code in DOC. I was still using RCTOneSignalExtensionService.h. Upon updating, the error is gone.

@rgomezp
Copy link
Contributor

rgomezp commented Oct 1, 2019

Great to hear! Please comment if you are still struggling with this issue and I can reopen

@rgomezp rgomezp closed this as completed Oct 1, 2019
@Dhanraj-bidchat
Copy link

Its still issue in RN:0.60.10 with pod.
how to use pod with it ?

@jsellam
Copy link

jsellam commented Jan 8, 2020

Hi,
I have same issue ld: library not found for -lPods-OneSignalNotificationServiceExtension
I'm using react-native 0.61.4 and onesignal 3.6.1

with pod deintegrate and cleaning and DerivedData

@jsellam
Copy link

jsellam commented Jan 8, 2020

I have found, but I don't know why, when I don't have a "Release" configuration in my configurations list, the "archive" fail with library not found.

archive fail :
Capture d’écran 2020-01-08 à 17 07 06

archive succeed 👍
Capture d’écran 2020-01-08 à 17 16 44

For your informations, Dev, Preprod & Prod are based on Release. It was working without "Release" on my olders projects with onesignal

Update @rgomezp :

  • Create a new react-native project
  • Add Onesignal
  • build & archive > it's ok
  • Rename "Release" configuration to an other name (like Dev)
  • build & archive > ld: library not found for -lPods-OneSignalNotificationServiceExtension

@madun
Copy link

madun commented Feb 13, 2020

Above suggestions are not working. Already updated to latest release v3.4.1, clean derived data, clean pods and reinstall but still getting error:

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

Podfile.lock

  - react-native-onesignal (3.4.1):
    - OneSignal (= 2.11.0)
    - React (< 1.0.0, >= 0.13.0)

UPDATE:
My bad. Turns out I need to replace the NotificationService.m contents with the latest code in DOC. I was still using RCTOneSignalExtensionService.h. Upon updating, the error is gone.

This not working for me

  • one-signal (3.6.2)
  • react-native (0.60.0)

@MrAlekhin
Copy link

Having the same issue right now. -lPods-OneSignalNotificationServiceExtension failed when i've added new schemes. Any updates on that?

@roysG
Copy link

roysG commented Apr 15, 2020

same

@Yassir4
Copy link

Yassir4 commented May 30, 2020

I had the same problem after upgrading react-native
This fixed my issue #651 (comment)

@hamaron
Copy link

hamaron commented Jul 28, 2020

I had the same problem when upgrading the RN version to 0.63.2 and trying to archive the app and I got fixed
by this.

It was a version mismatch between the version I specified in Podfile and the Target version that
I set for the OneSignal extension. As soon as I modified those two values to match each other,
the problem was gone.

Podfile
image

OneSignalNotificationExtension (or whatever you named to the notification extension)
image

@scesbron
Copy link

I have the same problem but none of the tips above solved my problem.

I have 2 projects that are quite similar : one that works and other that does not work.

In xcode build and archive steps are ok but on my CI or on my computer the command below succeeds on one project but fails on the other

xcodebuild "-workspace" "/Users/vagrant/git/packages/mobile-pro/ios/WecasaPro.xcworkspace" "-scheme" "WecasaPro" "-configuration" "Staging" "COMPILER_INDEX_STORE_ENABLE=NO" "archive" "-archivePath" "/var/folders/6q/wgy6jtp12w5gzgm9lzcglpqw0000gn/T/__archive__581470914/WecasaPro.xcarchive" "-destination" "generic/platform=iOS" | xcpretty

If I look at the logs of the command. For the project that works I have

▸ Building Pods/Pods-OneSignalNotificationServiceExtension [Staging]
▸ Check Dependencies
▸ Compiling Pods-OneSignalNotificationServiceExtension-dummy.m
▸ Compiling Pods-OneSignalNotificationServiceExtension-dummy.m
▸ Building library libPods-OneSignalNotificationServiceExtension.a
▸ Building library libPods-OneSignalNotificationServiceExtension.a
▸ Building WecasaPro/OneSignalNotificationServiceExtension [Staging]
▸ Check Dependencies
▸ Processing Info.plist
▸ Running script '[CP] Check Pods Manifest.lock'
▸ Compiling NotificationService.m
▸ Linking OneSignalNotificationServiceExtension
▸ Generating 'OneSignalNotificationServiceExtension.appex.dSYM'
▸ Touching OneSignalNotificationServiceExtension.appex
▸ Signing /Users/vagrant/Library/Developer/Xcode/DerivedData/WecasaPro-fuytaarwfdjqjucxpzvnzgjrhcvd/Build/Intermediates.noindex/ArchiveIntermediates/WecasaPro/IntermediateBuildFilesPath/UninstalledProducts/iphoneos/OneSignalNotificationServiceExtension.appex
▸ Touching OneSignalNotificationServiceExtension.appex.dSYM

For the project that does not work I have

▸ Compiling Pods-OneSignalNotificationServiceExtension-dummy.m
▸ Compiling Pods-OneSignalNotificationServiceExtension-dummy.m
▸ Running script 'Copy generated compatibility header'
▸ Building library libPods-OneSignalNotificationServiceExtension.a

I checked the config of both projects several times and they seem to be similar.

Does anyone have a clue on what can cause this ?

@scesbron
Copy link

After comparing my logs for the two projects I found that the one that succeeds uses the legacy build system but the other one uses the new build system.

I switched the projet to legacy build system but the problem is still there.

On the project that succeeds I have

CompileC /Users/scesbron/Library/Developer/Xcode/DerivedData/WecasaPro-guwmidkqvxjubvhfovvxnfhourjd/Build/Intermediates.noindex/ArchiveIntermediates/WecasaPro/IntermediateBuildFilesPath/Pods.build/Staging-iphoneos/Pods-OneSignalNotificationServiceExtension.build/Objects-normal/arm64/Pods-OneSignalNotificationServiceExtension-dummy.o Target\ Support\ Files/Pods-OneSignalNotificationServiceExtension/Pods-OneSignalNotificationServiceExtension-dummy.m normal arm64 objective-c com.apple.compilers.llvm.clang.1_0.compiler

and then

Libtool /Users/scesbron/Library/Developer/Xcode/DerivedData/WecasaPro-guwmidkqvxjubvhfovvxnfhourjd/Build/Intermediates.noindex/ArchiveIntermediates/WecasaPro/IntermediateBuildFilesPath/Pods.build/Staging-iphoneos/Pods-OneSignalNotificationServiceExtension.build/Objects-normal/armv7/libPods-OneSignalNotificationServiceExtension.a normal armv7

but on the other project after the compile I have a Ld command

Ld /Users/scesbron/Library/Developer/Xcode/DerivedData/wecasa-hcsnerxmdxdzhhhetgrrfvjexliq/Build/Intermediates.noindex/ArchiveIntermediates/wecasa/IntermediateBuildFilesPath/wecasa.build/Release-iphoneos/OneSignalNotificationServiceExtension.build/Objects-normal/armv7/OneSignalNotificationServiceExtension normal armv7

I don't know what is the difference between these commands and I don't know why the sequence is not the same

@scesbron
Copy link

Last comment on my problem. I removed the OneSignalNotificationServiceExtension target, the related objective-c files and the reference to OneSignal in my podfile. The xcodebuild command succeeds.

I've added back one signal by doing all the steps described in the doc https://documentation.onesignal.com/docs/react-native-sdk-setup

After that my xcodebuild command still fails on

Ld /Users/scesbron/Library/Developer/Xcode/DerivedData/wecasa-hcsnerxmdxdzhhhetgrrfvjexliq/Build/Intermediates.noindex/ArchiveIntermediates/wecasa/IntermediateBuildFilesPath/wecasa.build/Release-iphoneos/OneSignalNotificationServiceExtension.build/Objects-normal/armv7/Binary/OneSignalNotificationServiceExtension` normal armv7

the /Users/scesbron/Library/Developer/Xcode/DerivedData/wecasa-hcsnerxmdxdzhhhetgrrfvjexliq/Build/Intermediates.noindex/ArchiveIntermediates/wecasa/IntermediateBuildFilesPath/wecasa.build/Release-iphoneos/OneSignalNotificationServiceExtension.build/Objects-normal/armv7/Binary folder is empty, it does not contain a OneSignalNotificationServiceExtension file.

@pellarboss
Copy link

I have the same issue

@zanechua
Copy link

zanechua commented Jun 4, 2021

So...

This was a really hard one to trace down, I had to recreate a new RN 064.1 project to really find the fix to my issues. I am using schemes in my projects and I was applying fixes so that it'll build properly on M1.

Since the project has updated to using the new OneSignalXCFramework instead of the old fat framework, I decided to update the NSE to use that too in Podfile.

Was facing a ton of issues where the module was not found, including this one during build a release build or building to the simulator or a device

Turns out the part that was screwing with my code and causing the whole issue to not work is this following section in the Podfile

installer.pods_project.build_configurations.each do |config|
    config.build_settings["EXCLUDED_ARCHS[iphonesimulator=*]"] = "arm64"
end

In the end I had to only apply it to debug builds and not release builds. I'm not an iOS dev, so I don't know the intricacies on how excluding a simulator from an architecture would cause Pods to not be detected for the NSE but that was my issue.

Removing the entire block was what fixed it for me. Seems like it's not needed anymore for my project at least.

@agungs17
Copy link

agungs17 commented Sep 3, 2021

same issue!

@aeliusventure
Copy link

We tried with

post_install do |installer|
flipper_post_install(installer)
installer.pods_project.build_configurations.each do |config|
config.build_settings["EXCLUDED_ARCHS[sdk=iphonesimulator*]"] = "arm64"
end
end

in podfile

and

OneSignalNotificationServiceExtension -> deployment Info

iOS 13.0

and set in same group, we tested and succesfully build and run well.

@lurdharry
Copy link

I had the same problem when upgrading the RN version to 0.63.2 and trying to archive the app and I got fixed by this.

It was a version mismatch between the version I specified in Podfile and the Target version that I set for the OneSignal extension. As soon as I modified those two values to match each other, the problem was gone.

Podfile image

OneSignalNotificationExtension (or whatever you named to the notification extension) image

this solution works for me react-native-onesignal (4.3.3) and react-native": "0.64.2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests