Bitrise, Xcode9 (beta6): bitcode bundle could not be generated - ios

One of the frameworks I use fails to get built with Bitrise with Xcode9beta stack. I must point out that this is Bitrise-specific issue. Or either, Bitrise/Eureka issue. Eureka is a particular instance of third-party framework.
Project is built well on the local machine, no bitcode-related issues whatsoever. But whenever I run CI, I get that typical log:
❌ ld: bitcode bundle could not be generated because '.../Frameworks/Eureka.framework/Eureka' was built without full bitcode. All frameworks and dylibs for bitcode must be generated from Xcode Archive or Install build file '.../Frameworks/Eureka.framework/Eureka' for architecture armv7
❌ clang: error: linker command failed with exit code 1 (use -v to see invocation)
I followed these guidelines:
iOS library to BitCode
Flag is set.
I have also tried similar settings for head project/target, to no avail.
Any suggestions?

Seems to be a dependency (version) issue:
... was built without full bitcode. All frameworks and dylibs for bitcode must be generated ...
Might be enough to just upgrade the eureka dependency.
Another thing is that Xcode 9 (GM) is also available now, that alone might help.
Edit: a third option; you might have to disable Bitcode in the Xcode / xcodebuild command, as the default changed in Xcode 9 for some configs. See e.g. https://discuss.bitrise.io/t/xcode-archive-significantly-slower-on-xcode-9-0-x-stack-compared-to-xcode-8-3-x-stack/2708/2?u=viktorbenei
Without more log / info unfortunately it's quite hard to say with certainty.
If neither would help, you can also create an issue report at https://discuss.bitrise.io/c/issues/build-issues and the bitrise team will look into it ;)

Related

When publishing a project (swift 4.2) in the AppStore, an error occurs when linking the libPrinterSDK library.a

All kind time of day. The project on Swift uses the SDK for blueTouth printer Mini Thermal Printer POS-5805DD. The libPrinterSDK library (included with the printer) has been added to the root of the project.a and the PrinterSDK header file.h, header-file is connected via bridge, when you run the project on a real device-everything works correctly, no errors occur. But when you try to build a project to upload to the AppStore, at the very end when linovke libprintersdk library.a an error appears:
ld: bitcode bundle could not be generated because
'/Users/ivan/Documents/MyProject/PrinterSDK/libPrinterSDK.a
(GCDAsyncSocket.o)' was built without full bitcode. All object files
and libraries for bitcode must be generated from Xcode Archive or
Install build file
'/Users/ivan/Documents/MyProject/PrinterSDK/libPrinterSDK.a' for
architecture armv7
clang: error: linker command failed with exit code 1 (use -v to see invocation)
If there is any experience of building a project with libPrinterSDK files.a and PrinterSDK.h, I would really appreciate any help. Thanks.
Im not sure your project has turn Enable Bitcode off yet, if not, try to set No like this image below and Archive project again.
If it doesn't work, you can refer here

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 building while device is connected but not archiving

I am trying to build the project using this as basis :
GitHub code
but it is giving me error when i am trying to archive the project, while running it directly on device is okay. If i turn bitcode to off it makes the build but exit with some error on the iphone because dlib library is not being added needed for detection.
ld: bitcode bundle could not be generated because 'path/lib/libdlib.a(threads_kernel_shared.o)' was built without full bitcode. All object files and libraries for bitcode must be generated from Xcode Archive or Install build for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
I can see there is some problem in generation of dlib library but have no idea how to solve it up.
If anyone can guide me through it, i will be really thankful for the guidance. Thank you.
Try this - Worked for me
Goto Build Settings -> Enable Bitcode -> Select 'No'
And Archive with Generic Device selected.
Select Generic iOS Device while archiving

Linker Command failed while Archieving

I'm using a third-party framework which helps me to connect a device(Frameworks device). I'm getting
MySignalsConnectKit' was built without full bitcode. All frameworks
and dylibs 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)
error while trying to achieving. I can successfully build. I searched it but still can't solve the problem. Thank you!
Problem is probably because your third-party framework wasn't built with bitcode. If your application is archived with "Enable bitcode: YES" than all your frameworks must be built with bitcode also. Try to change it to NO, it may help. But then your archive will not contain bitcode. Better would be to get MySignalsConnectKit built with bitcode and use that build instead of one without bitcode.

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