0

Description

I can't build a production build of my react-native app with react-native-fbads as a dependency.

I get the following error:

ld: library not found for -lReactNativeAdsFacebook
clang: error: linker command failed with exit code 1 (use -v to see invocation)

When building for production release with this library I encounter this problem on iOS. Android is working fine. I am using the newest version from npm but it also happens with the master branch.

When setting Build Active Architecture Only to YES in XCode Build Settings and building for an iPhone 7 iOS 12 everything works fine. This is not a solution for production because older versions should also be supported.

With 4.2.0 it's building fine.

stack trace

Ld /Users/jobeso/Library/Developer/Xcode/DerivedData/playground-breooeaonoutyzaiywigdxwsujyp/Build/Intermediates.noindex/playground.build/Release-iphonesimulator/playground.build/Objects-normal/x86_64/playground normal x86_64 (in target: playground)
cd /Users/jobeso/projects/playground/ios
export IPHONEOS_DEPLOYMENT_TARGET=9.0
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -arch x86_64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.0.sdk -L/Users/jobeso/Library/Developer/Xcode/DerivedData/playground-breooeaonoutyzaiywigdxwsujyp/Build/Products/Release-iphonesimulator -F/Users/jobeso/Library/Developer/Xcode/DerivedData/playground-breooeaonoutyzaiywigdxwsujyp/Build/Products/Release-iphonesimulator -F/Users/jobeso/projects/playground/ios/Pods/FBAudienceNetwork -filelist /Users/jobeso/Library/Developer/Xcode/DerivedData/playground-breooeaonoutyzaiywigdxwsujyp/Build/Intermediates.noindex/playground.build/Release-iphonesimulator/playground.build/Objects-normal/x86_64/playground.LinkFileList -Xlinker -rpath -Xlinker @executable_path/Frameworks -mios-simulator-version-min=9.0 -dead_strip -Xlinker -object_path_lto -Xlinker /Users/jobeso/Library/Developer/Xcode/DerivedData/playground-breooeaonoutyzaiywigdxwsujyp/Build/Intermediates.noindex/playground.build/Release-iphonesimulator/playground.build/Objects-normal/x86_64/playground_lto.o -Xlinker -objc_abi_version -Xlinker 2 -fobjc-arc -fobjc-link-runtime -ObjC -lc++ -lxml2 -framework AVFoundation -framework AudioToolbox -framework CoreGraphics -framework CoreImage -framework CoreMedia -framework FBAudienceNetwork -framework Foundation -framework Security -framework StoreKit -framework UIKit -weak_framework AdSupport -weak_framework CoreMotion -weak_framework SafariServices -weak_framework WebKit -ObjC -lc++ -Xlinker -sectcreate -Xlinker __TEXT -Xlinker __entitlements -Xlinker /Users/jobeso/Library/Developer/Xcode/DerivedData/playground-breooeaonoutyzaiywigdxwsujyp/Build/Intermediates.noindex/playground.build/Release-iphonesimulator/playground.build/playground.app-Simulated.xcent /Users/jobeso/Library/Developer/Xcode/DerivedData/playground-breooeaonoutyzaiywigdxwsujyp/Build/Products/Release-iphonesimulator/libRCTBlob.a /Users/jobeso/Library/Developer/Xcode/DerivedData/playground-breooeaonoutyzaiywigdxwsujyp/Build/Products/Release-iphonesimulator/libRCTAnimation.a /Users/jobeso/Library/Developer/Xcode/DerivedData/playground-breooeaonoutyzaiywigdxwsujyp/Build/Products/Release-iphonesimulator/libReact.a /Users/jobeso/Library/Developer/Xcode/DerivedData/playground-breooeaonoutyzaiywigdxwsujyp/Build/Products/Release-iphonesimulator/libRCTActionSheet.a /Users/jobeso/Library/Developer/Xcode/DerivedData/playground-breooeaonoutyzaiywigdxwsujyp/Build/Products/Release-iphonesimulator/libRCTGeolocation.a /Users/jobeso/Library/Developer/Xcode/DerivedData/playground-breooeaonoutyzaiywigdxwsujyp/Build/Products/Release-iphonesimulator/libRCTImage.a /Users/jobeso/Library/Developer/Xcode/DerivedData/playground-breooeaonoutyzaiywigdxwsujyp/Build/Products/Release-iphonesimulator/libRCTLinking.a /Users/jobeso/Library/Developer/Xcode/DerivedData/playground-breooeaonoutyzaiywigdxwsujyp/Build/Products/Release-iphonesimulator/libRCTNetwork.a /Users/jobeso/Library/Developer/Xcode/DerivedData/playground-breooeaonoutyzaiywigdxwsujyp/Build/Products/Release-iphonesimulator/libRCTSettings.a /Users/jobeso/Library/Developer/Xcode/DerivedData/playground-breooeaonoutyzaiywigdxwsujyp/Build/Products/Release-iphonesimulator/libRCTText.a /Users/jobeso/Library/Developer/Xcode/DerivedData/playground-breooeaonoutyzaiywigdxwsujyp/Build/Products/Release-iphonesimulator/libRCTVibration.a /Users/jobeso/Library/Developer/Xcode/DerivedData/playground-breooeaonoutyzaiywigdxwsujyp/Build/Products/Release-iphonesimulator/libRCTWebSocket.a -lPods-playground -lReactNativeAdsFacebook -Xlinker -dependency_info -Xlinker /Users/jobeso/Library/Developer/Xcode/DerivedData/playground-breooeaonoutyzaiywigdxwsujyp/Build/Intermediates.noindex/playground.build/Release-iphonesimulator/playground.build/Objects-normal/x86_64/playground_dependency_info.dat -o /Users/jobeso/Library/Developer/Xcode/DerivedData/playground-breooeaonoutyzaiywigdxwsujyp/Build/Intermediates.noindex/playground.build/Release-iphonesimulator/playground.build/Objects-normal/x86_64/playground

Reproducible Demo

sample project on gitlab

issue

issue on github

Jobeso
  • 553
  • 1
  • 7
  • 11

1 Answers1

0

This was a problem with the header search paths in the library. A pr with a fix is in the linked github issue.

Jobeso
  • 553
  • 1
  • 7
  • 11