React-native-onesignal: library not found for -lPods-OneSignalNotificationServiceExtension

Created on 1 Mar 2021  路  13Comments  路  Source: OneSignal/react-native-onesignal

After upgrading to Xcode 12, I starting encountering this issue.
I tried the answers that suggestes to remove the arm64 from the build options, which did nothing for my case.
I tried updating to version 4.0.4, and pod 3.0 to 4.0 which did nothing either.
I tried moving the minimum version to ios 11.0, which did nothing as well.
I also tried adding
config.build_settings["EXCLUDED_ARCHS[sdk=iphonesimulator*]"] = "arm64" as suggested in other issues but it did not solve either.

Here is my podfile:

platform :ios, '11.0'
# require_relative '../node_modules/react-native/scripts/react_native_pods'
require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules'

def add_flipper_pods!(versions = {})
  versions['Flipper'] ||= '~> 0.33.1'
  versions['DoubleConversion'] ||= '1.1.7'
  versions['Flipper-Folly'] ||= '~> 2.1'
  versions['Flipper-Glog'] ||= '0.3.6'
  versions['Flipper-PeerTalk'] ||= '~> 0.0.4'
  versions['Flipper-RSocket'] ||= '~> 1.0'

  pod 'FlipperKit', versions['Flipper'], :configuration => 'Debug'
  pod 'FlipperKit/FlipperKitLayoutPlugin', versions['Flipper'], :configuration => 'Debug'
  pod 'FlipperKit/SKIOSNetworkPlugin', versions['Flipper'], :configuration => 'Debug'
  pod 'FlipperKit/FlipperKitUserDefaultsPlugin', versions['Flipper'], :configuration => 'Debug'
  pod 'FlipperKit/FlipperKitReactPlugin', versions['Flipper'], :configuration => 'Debug'

  # List all transitive dependencies for FlipperKit pods
  # to avoid them being linked in Release builds
  pod 'Flipper', versions['Flipper'], :configuration => 'Debug'
  pod 'Flipper-DoubleConversion', versions['DoubleConversion'], :configuration => 'Debug'
  pod 'Flipper-Folly', versions['Flipper-Folly'], :configuration => 'Debug'
  pod 'Flipper-Glog', versions['Flipper-Glog'], :configuration => 'Debug'
  pod 'Flipper-PeerTalk', versions['Flipper-PeerTalk'], :configuration => 'Debug'
  pod 'Flipper-RSocket', versions['Flipper-RSocket'], :configuration => 'Debug'
  pod 'FlipperKit/Core', versions['Flipper'], :configuration => 'Debug'
  pod 'FlipperKit/CppBridge', versions['Flipper'], :configuration => 'Debug'
  pod 'FlipperKit/FBCxxFollyDynamicConvert', versions['Flipper'], :configuration => 'Debug'
  pod 'FlipperKit/FBDefines', versions['Flipper'], :configuration => 'Debug'
  pod 'FlipperKit/FKPortForwarding', versions['Flipper'], :configuration => 'Debug'
  pod 'FlipperKit/FlipperKitHighlightOverlay', versions['Flipper'], :configuration => 'Debug'
  pod 'FlipperKit/FlipperKitLayoutTextSearchable', versions['Flipper'], :configuration => 'Debug'
  pod 'FlipperKit/FlipperKitNetworkPlugin', versions['Flipper'], :configuration => 'Debug'
end

# Post Install processing for Flipper
def flipper_post_install(installer)
  installer.pods_project.targets.each do |target|
    if target.name == 'YogaKit'
      target.build_configurations.each do |config|
        config.build_settings['SWIFT_VERSION'] = '4.1'
      end
    end
  end
end

target 'Superprof' do
  # Pods for Superprof
  # config = use_native_modules!
  pod 'FBLazyVector', :path => "../node_modules/react-native/Libraries/FBLazyVector"
  pod 'FBReactNativeSpec', :path => "../node_modules/react-native/Libraries/FBReactNativeSpec"
  pod 'RCTRequired', :path => "../node_modules/react-native/Libraries/RCTRequired"
  pod 'RCTTypeSafety', :path => "../node_modules/react-native/Libraries/TypeSafety"
  pod 'React', :path => '../node_modules/react-native/'
  pod 'React-Core', :path => '../node_modules/react-native/'
  pod 'React-CoreModules', :path => '../node_modules/react-native/React/CoreModules'
  pod 'React-Core/DevSupport', :path => '../node_modules/react-native/'
  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-Core/RCTWebSocket', :path => '../node_modules/react-native/'

  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 'ReactCommon/callinvoker', :path => "../node_modules/react-native/ReactCommon"
  pod 'ReactCommon/turbomodule/core', :path => "../node_modules/react-native/ReactCommon"
  pod 'Yoga', :path => '../node_modules/react-native/ReactCommon/yoga', :modular_headers => true

  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'

  pod 'RNGestureHandler', :podspec => '../node_modules/react-native-gesture-handler/RNGestureHandler.podspec'

  pod 'Stripe', '~> 19.0.1'
  pod 'tipsi-stripe', :path => '../node_modules/tipsi-stripe'

  pod 'GoogleSignIn', '~> 5.0.2'
  pod 'RNGoogleSignin', :path => '../node_modules/@react-native-community/google-signin'

  pod 'react-native-onesignal', :path => '../node_modules/react-native-onesignal'

  pod 'ReactNativeLocalization', :path => '../node_modules/react-native-localization'

  pod 'RNCAsyncStorage', :path => '../node_modules/@react-native-community/async-storage'

  permissions_path = '../node_modules/react-native-permissions/ios'
  pod 'Permission-Notifications', :path => "#{permissions_path}/Notifications"

  use_native_modules!
  # use_react_native!(:path => config["reactNativePath"])

  target 'SuperprofTests' do
    inherit! :complete
    # Pods for testing
  end

  # Enables Flipper.
  #
  # Note that if you have use_frameworks! enabled, Flipper will not work and
  # you should disable these next few lines.
  # use_flipper!
  add_flipper_pods!
  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
end

target 'Superprof-tvOS' do
  # Pods for Superprof-tvOS

  target 'Superprof-tvOSTests' do
    inherit! :search_paths
    # Pods for testing
  end
end

target 'OneSignalNotificationServiceExtension' do
  # Comment the next line if you're not using Swift and don't want to use dynamic frameworks
  # use_frameworks!

  # Pods for OneSignalNotificationServiceExtension
  pod 'OneSignal', '>= 2.9.3', '< 5.0'

end

using "react-native-onesignal": "4.0.4",

 /Users//code//Superprof/ios/DerivedData/Superprof/Build/Products/Debug-iphonesimulator/OneSignalNotificationServiceExtension.appex/OneSignalNotificationServiceExtension normal (in target 'OneSignalNotificationServiceExtension' from project 'Superprof')
    cd /Users//code//Superprof/ios
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -target x86_64-apple-ios11.0-simulator -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk -L/Users//code//Superprof/ios/DerivedData/Superprof/Build/Products/Debug-iphonesimulator -L/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator -L/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift-5.0/iphonesimulator -F/Users//code//Superprof/ios/DerivedData/Superprof/Build/Products/Debug-iphonesimulator -F/Users//code//Superprof/ios/Pods/OneSignal/iOS_SDK/OneSignalSDK/Framework -filelist /Users//code//Superprof/ios/DerivedData/Superprof/Build/Intermediates.noindex/Superprof.build/Debug-iphonesimulator/OneSignalNotificationServiceExtension.build/Objects-normal/x86_64/OneSignalNotificationServiceExtension.LinkFileList -Xlinker -rpath -Xlinker /usr/lib/swift -Xlinker -rpath -Xlinker /usr/lib/swift -Xlinker -rpath -Xlinker @executable_path/Frameworks -Xlinker -rpath -Xlinker @executable_path/../../Frameworks -dead_strip -Xlinker -object_path_lto -Xlinker /Users//code//Superprof/ios/DerivedData/Superprof/Build/Intermediates.noindex/Superprof.build/Debug-iphonesimulator/OneSignalNotificationServiceExtension.build/Objects-normal/x86_64/OneSignalNotificationServiceExtension_lto.o -Xlinker -export_dynamic -Xlinker -no_deduplicate -Xlinker -objc_abi_version -Xlinker 2 -fapplication-extension -fobjc-link-runtime -L/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator -L/usr/lib/swift -Xlinker -add_ast_path -Xlinker /Users//code//Superprof/ios/DerivedData/Superprof/Build/Intermediates.noindex/Superprof.build/Debug-iphonesimulator/OneSignalNotificationServiceExtension.build/Objects-normal/x86_64/OneSignalNotificationServiceExtension.swiftmodule -ObjC -framework CoreGraphics -framework OneSignal -framework SystemConfiguration -framework UIKit -framework UserNotifications -framework WebKit -e _NSExtensionMain -Xlinker -sectcreate -Xlinker __TEXT -Xlinker __entitlements -Xlinker /Users//code//Superprof/ios/DerivedData/Superprof/Build/Intermediates.noindex/Superprof.build/Debug-iphonesimulator/OneSignalNotificationServiceExtension.build/OneSignalNotificationServiceExtension.appex-Simulated.xcent -lPods-OneSignalNotificationServiceExtension -Xlinker -no_adhoc_codesign -Xlinker -dependency_info -Xlinker /Users//code//Superprof/ios/DerivedData/Superprof/Build/Intermediates.noindex/Superprof.build/Debug-iphonesimulator/OneSignalNotificationServiceExtension.build/Objects-normal/x86_64/OneSignalNotificationServiceExtension_dependency_info.dat -o /Users//code//Superprof/ios/DerivedData/Superprof/Build/Products/Debug-iphonesimulator/OneSignalNotificationServiceExtension.appex/OneSignalNotificationServiceExtension

Most helpful comment

@cleandersonlobo @jsellam @CGkekloon @hugoh59

Fixing the issue was pretty clear and easy in my case so I would like to share it.
(of course first I had to read every possible answer in the whole internet and mess
with the configuration of the Project on Xcode for 1000 times)

The thing is I just blindly followed the guide for installing OneSignal for ReactNative:
https://documentation.onesignal.com/docs/react-native-sdk-setup

And there's a certain step that says:

_"Ensure the Deployment Target is set to iOS 10 for maximum platform compatibility."_

Screenshot 2021-03-06 at 9 36 47 PM

Thing is that:

  • My application's target, in the deployment info section, had iOS 11.0 and only iPhone checked
  • OneSignal's target, because I just did what the manual suggested without thinking about it,
    had iOS 10.0 and both iPhone and iPad checked

After changing OneSignal's target deployment info to be exactly the same as for my main application's target I managed to build the app for release on Xcode :)!

Hope it helps you too!

All 13 comments

Hi, do you solved this problem? I have the same issue on it

I have the same issue to with XCode 12.1

+1

+1

@cleandersonlobo @jsellam @CGkekloon @hugoh59

Fixing the issue was pretty clear and easy in my case so I would like to share it.
(of course first I had to read every possible answer in the whole internet and mess
with the configuration of the Project on Xcode for 1000 times)

The thing is I just blindly followed the guide for installing OneSignal for ReactNative:
https://documentation.onesignal.com/docs/react-native-sdk-setup

And there's a certain step that says:

_"Ensure the Deployment Target is set to iOS 10 for maximum platform compatibility."_

Screenshot 2021-03-06 at 9 36 47 PM

Thing is that:

  • My application's target, in the deployment info section, had iOS 11.0 and only iPhone checked
  • OneSignal's target, because I just did what the manual suggested without thinking about it,
    had iOS 10.0 and both iPhone and iPad checked

After changing OneSignal's target deployment info to be exactly the same as for my main application's target I managed to build the app for release on Xcode :)!

Hope it helps you too!

@cleandersonlobo @jsellam @CGkekloon @hugoh59

Fixing the issue was pretty clear and easy in my case so I would like to share it.
(of course first I had to read every possible answer in the whole internet and mess
with the configuration of the Project on Xcode for 1000 times)

The thing is I just blindly followed the guide for installing OneSignal for ReactNative:
https://documentation.onesignal.com/docs/react-native-sdk-setup

And there's a certain step that says:

_"Ensure the Deployment Target is set to iOS 10 for maximum platform compatibility."_

Screenshot 2021-03-06 at 9 36 47 PM

Thing is that:

  • My application's target, in the deployment info section, had iOS 11.0 and only iPhone checked
  • OneSignal's target, because I just did what the manual suggested without thinking about it,
    had iOS 10.0 and both iPhone and iPad checked

After changing OneSignal's target deployment info to be exactly the same as for my main application's target I managed to build the app for release on Xcode :)!

Hope it helps you too!

this work for me ! Thank man

Thanks! @peterbenos

It worked!

Hi @peterbenos ,

Changed the target, but still facing this issue.

Any other workaround?

Thanks

I'm seeing the same issue.

@akhilsanker @brandonking7 ,
Are y'all using the old "manual linking" instructions?

@rgomezp i use manual linking (RN 0.63.4) and have the same issue too.
is it wrong using manual linking?

@gwijaya94 ,
Yes. We no longer support manual linking automatically. However, if you would like to, you can add support yourself by updating the native binary by following these instructions.

Hi guys,
I'm currently updating an app from RN 0.62.2 to RN 0.64.1, so I also updated the Stripe pod to 21.5.1, and tipsi-stripe to 9.0.0.

I'm currently facing the exact same issue, both of my targets have the same deployment infos, but still experiencing this error
ld: warning: directory not found for option '-L"/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator" "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift-5.0/iphonesimulator" ""' ld: library not found for -lPods-OneSignalNotificationServiceExtension

Did you guys find any solution to this ?

Cheers

Was this page helpful?
0 / 5 - 0 ratings