XCode - clang: error: linker command failed with exit code 1 - ios

Trying to archive React Native iOS app in XCode
facing that issue
'/Users/mac/Library/Developer/Xcode/DerivedData/MalaebappV3-booqrwdhpgaifkchtlgmmtgyayxd/Build/Intermediates.noindex/ArchiveIntermediates/MalaebappStage/BuildProductsPath/Release-iphoneos/XCFrameworkIntermediates/FBAEMKit/FBAEMKit.framework/FBAEMKit'
does not contain bitcode. You must rebuild it with bitcode enabled
(Xcode setting ENABLE_BITCODE), obtain an updated library from the
vendor, or disable bitcode for this target. file
'/Users/mac/Library/Developer/Xcode/DerivedData/MalaebappV3-booqrwdhpgaifkchtlgmmtgyayxd/Build/Intermediates.noindex/ArchiveIntermediates/MalaebappStage/BuildProductsPath/Release-iphoneos/XCFrameworkIntermediates/FBAEMKit/FBAEMKit.framework/FBAEMKit'
for architecture arm64
that same code archive normally in M1 chip mac, but fire this issue in my intel one
also, I can run the code normally in the simulator, but the archive process never success and fire that above error

Related

WebRTC' does not contain bitcode You must rebuild it with bitcode enabled (Xcode setting ENABLE_BITCODE)

My app works on the simulator when I run: npx react-native run-ios
However when I try to get the ipa file by 'Archive'-ing it via the .xcworkspace
I get the following error regarding WebRTC and bitcode.
How to fix this issue?
ld:
'/Users/bliss/Library/Developer/Xcode/DerivedData/DanceConnectyCube-czcpkmpwkpsbethjfvbfindeabwg/Build/Intermediates.noindex/ArchiveIntermediates/DanceConnectyCube/BuildProductsPath/Release-iphoneos/XCFrameworkIntermediates/react-native-webrtc/WebRTC.framework/WebRTC'
does not contain bitcode. You must rebuild it with bitcode enabled
(Xcode setting ENABLE_BITCODE), obtain an updated library from the
vendor, or disable bitcode for this target. file
'/Users/bliss/Library/Developer/Xcode/DerivedData/DanceConnectyCube-czcpkmpwkpsbethjfvbfindeabwg/Build/Intermediates.noindex/ArchiveIntermediates/DanceConnectyCube/BuildProductsPath/Release-iphoneos/XCFrameworkIntermediates/react-native-webrtc/WebRTC.framework/WebRTC'
for architecture arm64 clang: error: linker command failed with exit
code 1 (use -v to see invocation)
you need to remove bitcode in your ios project setting in xcode target->build settings-> enable bitcode or use a custom webrtc build that enable it at compile time (huge build).
I made one here
edit:
a build with bitcode and swiftmodule support
This Repo also have sh script that explain the procedure.
For those came here with the same error:
If you are trying to debug your app in your iPhone you have to select bitcode=no in order to work.

Xcode 7 Fails to Archive

I am using Xcode 7.3.1.
My project runs perfectly on both iOS Simulator as well as my own iPhone. However, when archiving my project, I get the warnings and errors:
ld: warning: ignoring file /Users/parthsaxena/Desktop/Vantage/Vantage/Vantage/TextFieldEffects/TextFieldEffects.framework/TextFieldEffects, file was built for arm64 which is not the architecture being linked (armv7): /Users/parthsaxena/Desktop/Vantage/Vantage/Vantage/TextFieldEffects/TextFieldEffects.framework/TextFieldEffects
ld: bitcode bundle could not be generated because '/Users/parthsaxena/Desktop/Vantage/Vantage/Pods/FirebaseAppIndexing/Frameworks/FirebaseAppIndexing.framework/FirebaseAppIndexing(FIRAppIndexing.o)' was built without full bitcode. All object files and libraries for bitcode must be generated from Xcode Archive or Install build for architecture armv7
clang: error: linker command failed with exit code 1 (use -v to see invocation)
You may have noticed that I am using both the Firebase and TextFieldEffects frameworks in my project.
Is there any solution to this problem?
Your library was compiled without bitcode, but the bitcode option is enabled in your project settings. Say NO to Enable Bitcode in your target Build Settings and the Library Build Settings to remove the warnings.
For those wondering if enabling bitcode is required:
Note: For iOS apps, bitcode is the default, but optional. If you provide bitcode, all apps and frameworks in the app bundle need to include bitcode. For watchOS apps, bitcode is required.
https://developer.apple.com/library/prerelease/watchos/documentation/IDEs/Conceptual/AppDistributionGuide/AppThinning/AppThinning.html
Firebase doesn't support bitcode at the moment (the situation should change in a short time). You should set Build Settings -> Enable Bitcode to NO.
I was getting this error because i didn't have enough free space on my mac

linker error when 'archive' a sample swift project with ooVoo framework

I have a sample swift video chat app that I build with the help from ooVoo framework. The app builds and runs as expected when I simply run it from Xcode on my iPhone 5s phone. When I switch the device to 'Generic iOS Device' and run 'Product'->'Archive' to get the app ready for test, flight I get a linker error.
ld: bitcode bundle could not be generated because
'/Users/Shared/ooVooSDK/lib/ooVooSDK.framework/ooVooSDK(SdkResult.o)'
was built without full bitcode. All object files and libraries for
bitcode must be generated from Xcode Archive or Install build for
architecture armv7 clang: error: linker command failed with exit code
1 (use -v to see invocation)
What am I missing? We have the ooVoo framework version 2.2.0.72.
You have to disable bitcode for your app if all the frameworks aren't built with bitcode support.

XCode fail to build facebook plugin

When I try with cordova build ios or cordova run ios, the build is success and deploy to simulator. However, when I try to run it in XCode to deploy it to device, the build end up with this error:
ld: 'MyApp/Plugins/com.phonegap.plugins.facebookconnect/FacebookSDK.framework/FacebookSDK(FBLikeButtonBackgroundSelectedPNG.o)' does not contain bitcode. You must rebuild it with bitcode enabled (Xcode setting ENABLE_BITCODE), obtain an updated library from the vendor, or disable bitcode for this target. for architecture armv7
clang: error: linker command failed with exit code 1 (use -v to see invocation)
If I remove the facebook plugin (https://github.com/Telerik-Verified-Plugins/Facebook), it will build success. How can I fix it?

Getting Cordova error on Xcode 7 build for Facebook Plugin

I updated to XCode 7 today. As suggested in the Cordova Facebook Plugin I cloned the git repo and am installing the plugin from there. Before the update to XCode 7 I had no problems building. Now I am getting the below error.
Error:
ld: 'App/Plugins/phonegap-facebook-plugin/FacebookSDK.framework/FacebookSDK(FBLikeButtonBackgroundSelectedPNG.o)' does not contain bitcode. You must rebuild it with bitcode enabled (Xcode setting ENABLE_BITCODE), obtain an updated library from the vendor, or disable bitcode for this target. for architecture armv7
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Any thoughts?
I tried removing and re-adding the ios platform with no luck.
Also this builds fine to the emulator.
You have to disable bitcode (next cordova ios release will come with bitcode disabled)
You can do that on the xcode project, open the .xcodeproj on yourProject/platforms/ios/, and on the project build settings search for ENABLE_BITCODE and set it to NO
Or you can go to /platforms/ios/cordova and add this line on the build.xcconfig
ENABLE_BITCODE = NO

Resources