Xcode 7 'CrashReporter does not contain bitcode' linker error - ios

I am directly linking PLCrashReporter in my iOS app without using any external tool and now when I try to compile it on Xcode 7 I get link error:
ld:
'.../CrashReporter.framework/CrashReporter(libCrashReporter-iphoneos.a-armv7-master.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
Where do I get the updated framework or the sources to compile them with bitcode enabled and get rid of the error without disabling bitcode for the full project?

I ended up addressing this by building PLCrashReporter 1.2.1 from source. This version is the minimum that has had Xcode 7 and iOS9 fixes merged.
The source is obtained from here: PLCrashReporter 1.2.1
Unzip the downloaded 1.2.1 source into a folder.
Pull the Xcode project inside that folder up within Xcode and add the following to the Custom Compiler Settings "Other C Flags" section of the project build settings: -fembed-bitcode
Next add the following to the Custom Compiler Settings "Other Warning Flags" section of the project build settings: -Wno-error=unused-command-line-argument
Then close the project from the Xcode GUI. The custom settings are necessary because we are going to build from the command line using xcodebuild to avoid the PLCR deprecation errors, and when doing so the default is only -fembed-bitcode-marker when building a framework this way. We are overriding the default behavior, and need to suppress the hard stop warning this causes.
Lastly, from a terminal window prompt within the folder where the zip file of the source including the xcode project file is located run the following:
xcodebuild -configuration Release -target 'Disk Image'
This will run the build and leave the framework in ./build/Release/PLCrashReporter-1.2.1/iOS Framework
Now, these steps will produce a bitcode enabled framework, but third party crash reporting is incompatible with bitcode (when the App Store recompiles you have no way to get the symbol file from that on the fly build).

There is 2 options.
1. Download PLCrashReporter sources and compile it whit bitcode enabled, and use that in your project.
2. Disable bitcode for your target
Go to your target's Build Settings tab, search for Enable Bitcode set value to NO.

This worked for me, in order to include Rollbar framework in my project:
Within my workspace, I first select my project from the Project Navigator -> my project's target -> Build Settings -> Enable Bitcode = NO
Then I select the PODS from the Project Navigator -> Rollbar Target -> Enable Bitcode = NO

Experienced same issue. I built the crash reporter framework from source using
https://www.plcrashreporter.org/code
Open it in Xcode
Select the 'CrashReporter' target with the red bullseye.
Build it
Then search in ~/Library/Developer/Xcode/DerivedData/CrashReporter-xxxxxxx to get the .framework bundle

Unfortunately the issue presented itself again. Also when I try to compile again I get:
ld: warning: object file
(/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/arc/libarclite_macosx.a(cf.o))
was built for newer OSX version (10.6) than being linked (10.5) ld:
warning: object file
(/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/arc/libarclite_macosx.a(arclite.o))
was built for newer OSX version (10.6) than being linked (10.5)
Moreover if I set enable bit code at the project level I get an immediate error:
target 'CrashReporter-MacOSX-Static' has bitcode enabled (ENABLE_BITCODE = YES), but it is not supported for the 'macosx' platform
What should I do to produce the framework with bitcode enabled?

Related

Binary iOS framework archive error: bitcode bundle could not be generated because framework was built without full bitcode

I have created a binary iOS framework (framework with source obfuscated), and after jumping through hoops to get it to run, it gives an error on archive
bitcode bundle could not be generated because framework was built without full bitcode
bitcode bundle could not be generated because framework was built without full bitcode. All frameworks and dylibs for bitcode must be generated from Xcode Archive or Install build file -framework path- for architecture arm64
I set validate workspace to YES, and set the framework to sign & embed
I tried setting enable bitcode to NO and YES,
I tried setting skip install to YES and NO
I tried setting enable bitcode to yes and no, and I tried what this comment suggested:
https://stackoverflow.com/a/60265097/15266127
And I still have the same error. It's actually driving me insane.
This feels like I'm working through some dystopian level bureaucracy. Help me out here I'm suffering.

bitcode bundle could not be generated because

Basically I have built a compiled released framework and distributed it with cocoaPods. The problem is that then archiving this framework application gets the following error:
ld: bitcode bundle could not be generated because
'/Users/cagrialtay/Desktop/mucbirsebepler/ios/Flutter/Flutter.framework/Flutter'
was built without full bitcode. All frameworks and dylibs for bitcode
must be generated from Xcode Archive or Install build file
'/Users/cagrialtay/Desktop/mucbirsebepler/ios/Flutter/Flutter.framework/Flutter'
for architecture armv7 clang: error: linker command failed with exit
code 1 (use -v to see invocation) Search for Enable Bitcode setting
and set it to YES for Debug and Release modes.
Things I tried but had no luck
Enable Bitcode' set to 'YES' Adding '-fembed-bitcode' to 'Other C
Flags' Adding 'BITCODE_GENERATION_MODE' with the value 'bitcode' set
skip install to yes
I only need release version, so I did not built an universal framework, just release version... I would genuinely like to solve this issue, because it has been a nightmare for me..
I finally solved this.This error happened because of me . I develop my iOS application with flutter, so if you develop your iOS app in Flutter firstly you must build with flutter not Xcode
flutter clean
flutter build ios
then go
Xcode -> Product -> Destination -> Any iOS Device
Xcode-> Product -> Scheme -> choose scheme -> Runner
Xcode-> Product -> Archive
or
flutter clean
flutter build ipa
then
Xcode-> Product -> Archive
That happened to me too. Xcode 11, Flutter. I tried deleting the App on Simulator still did not work.
Open project folder
Go to ios file
Go to Runner Folder
Right click on "Launch Screen.storyboard"
Open with Xcode.

bitcode bundle could not be generated because framework was built without full bitcode

I'm trying to build a dynamic framework (Module scheme) that needs to have bitcode enabled. I have set the Enable bitcode option from Build Settings section to YES for both the framework project and target.
In the Other C Flags section I have set the value -fembed-bitcode-marker for Debug and -fembed-bitcode for Release but the error still occurs when I try to archive the iOS project that uses my framework.
I've also tried to add a new user defined setting BITCODE_GENERATION_MODE having the following values:
marker for Debug
bitcode for Release
The following error still persists
bitcode bundle could not be generated because ... framework was built without full bitcode. All frameworks and dylibs for bitcode must be generated from XCode Archive or Install build file...
Any idea how to solve this ?

Bitcode bundle could not be generated for arm64

I'm encountering a build error when I set 'Enable Bitcode' to 'YES' in the build settings of a project I'm currently working on. The error is:
ld: bitcode bundle could not be generated because '/Users/nick/Library/Developer/Xcode/DerivedData/PROJECTNAME-esksqmlmtpqewpbktcqeqloackeu/Build/Intermediates.noindex/PROJECT.build/Debug-iphoneos/PROJECTNAME.build/Objects-normal/arm64/main.o' was built without full bitcode. All object files and libraries for bitcode must be generated from Xcode Archive or Install build file '/Users/nick/Library/Developer/Xcode/DerivedData/PROJECTNAME-esksqmlmtpqewpbktcqeqloackeu/Build/Intermediates.noindex/PROJECT.build/Debug-iphoneos/PROJECTNAME.build/Objects-normal/arm64/main.o' for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
(I've redacted the project name to PROJECTNAME and a variant to PROJECT to post here.)
At first I though it could be due to one of the dependencies this project is using via Cocoapods but they all have 'Enable Bitcode' set to 'YES' and I'd expect to see the name of the offending library in the error message if that was the case. The project uses no frameworks other than those included via Cocoapods (and Apple frameworks).
I've tried deleting the derived data, restarting Xcode as well as clearing the build folder but the error persists.
I've also tried the '-fembed-bitcode-marker' solution as suggested for a similar problem here:
iOS library to BitCode
But I'm not building a static library but an app so perhaps unsurprising it made no difference.
The project is fairly large and has been developed since 2012 so includes Objective-C and Swift. It currently has iOS 8 as deployment target and 11.2 as base SDK. It's never had Bitcode enabled in any dev or production version in the past. We've got Bitcode enabled on similar but more recent projects. We're currently using Xcode 9.2 (9C40b).
I know I could set 'Enable Bitcode' to 'NO' for the project's build settings to 'fix' the error but I'd rather have bitcode enabled for the re-optimisations Apple can do once the binary is uploaded as mentioned here:
Apple Docs - App Thinning
Am I missing a flag in the build settings that fixes this error or perhaps something else? Any advice is much appreciated!
Many thanks,
Nick
After updating to Xcode 10 we tried to generate a Bitcode bundle again for this project and (after trying different build configs) have been able to do so. The config that eventually worked for this project was:
For the Project's and Pod's Build Settings:
'Enable Bitcode' set to 'YES'
Adding '-fembed-bitcode' to 'Other C Flags'
Adding 'BITCODE_GENERATION_MODE' with the value 'bitcode'
These settings were needed for Debug as well as Release. This is because Debug would throw the 'bitcode could not be generated' error (see original question) if we tried to use the '-fembed-bitcode-marker' or 'marker' flags.
We'd have preferred to use the 'marker' variants for Debug as it's quicker to compile but at least we now have something that works!

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

Resources