Xcode Bot bitcode error during integration only - ios

ld: '/Library/Developer/XcodeServer/Integrations/Caches/5c17d3e903f4d302cf453 40fb301f30f/Source/ocular/Pods/Sodium/Sodium/libsodium- ios.a(libsodium_la-crypto_box.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
I ran /usr/local/bin/pod install before integration (Triggers).
I am able to build and run the app in simulator & real device. However my integration with bot failed with the above error message. I install Sodium via cocoapods.
I tried setting ENBALE_BITCODE = NO for project/targets/Pods
Server: 5.1.7
Xcode: 7.3.1
Any help is appreciated.

The error saying that you need to ENBALE_BITCODE = NO under your project target Change that and it will gonna work.

xCode -> your project -> Build Settings -> Enable Bitcode = NO .

After searching for the solutions online and the only solution i can find is Enable Bitcode = NO. Which is what i already had!
So eventually i use the WILD CARD SOLUTION which is to restart Xcode & Server - Still throws the same error. Since there's really no solution, i restarted my mac. First time still throws errors and TADA second time it works.I have no idea what have i done to make it work or what have i not done to make it work.
PS: I clean and clean build folder each time before i integrate my bot.
To anyone who faced the same issue: good luck

Related

flutter swift Command PhaseScriptExecution failed with a nonzero exit code

When i want to make archive to upload app on apple Store in the end of archive i get this error /bin/sh -c /Users/aneeq/Library/Developer/Xcode/DerivedData/Runner-hfzveethzxphozduylnhsnbtzzct/Build/Intermediates.noindex/ArchiveIntermediates/Runner/IntermediateBuildFilesPath/Runner.build/Release-iphoneos/Runner.build/Script-9740EEB61CF901F6004384FC.sh
and also this waring
None of the architectures in ARCHS (arm64) are valid. Consider setting ARCHS to $(ARCHS_STANDARD) or updating it to include at least one value from VALID_ARCHS (x86_64).
can someone kindly help me with this and also its run fine on emulator.
Its flutter Application not Native.
The problem is that you need the latest version of MacOS and Xcode, in this case, Xcode 12.5.1 and MacOs Big Sur 11.5.2.
Generally, that can be a problem that you do not have the most recent version of MacOS and Xcode, you can try updating or checking if you have any update, then check if you have your linked libraries correctly.
Had this issue, Fixed by opening XCode using rosetta.
I see many people experiencing this problem - and many different possible solutions. For me, I had accidentally messed with the certificates in Keychain Access. To fix, I deleted those, signed out of my account in Xcode (preferences), and then signed back in. Then in signing and capabilities, I'd select my account, Xcode would prompt me to revoke the old certificates (no longer found) and then create a brand new set. Then my app would build.
For me, clean derived data was required.
~/Library/Developer/Xcode/DerivedData
just delete import 'dart:html';

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!

dyld: Library not loaded: #rpath/libswiftCore.dylib on Xcode 9 only

I recently upgraded to Xcode 9 from 8.3.3.
Our project is written in Objective-C as are all the other frameworks we use. I have added a framework which is written in Swift (version 3.0). In Xcode 8, I am able to build and run the project without problem in simulator and on device. In Xcode 9 I am unable to run the project on simulator or device due to the error:
dyld: Library not loaded: #rpath/libswiftCore.dylib
Referenced from: .../libraryname
Reason: image not found
After downgrading, I was able to run the project again.
My configuration has:
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
STRIP_SWIFT_SYMBOLS = NO;
SWIFT_VERSION = 3.0;
After battling for several hours with this error and trying various solutions, my solution turned out to be different than others here so I'm adding it for others who may benefit.
I tried:
- ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES
- LD_RUNPATH_SEARCH_PATHS = $(inherited) #executable_path/Frameworks
No luck. Turned out the issue was more basic. My project has multiple build targets and somehow the setting for Host Application had gotten unset.
The Swift framework has to be built with the same version of Swift as your project (in this case Swift 4 inherantly since you upgraded and are running through Xcode 9).
Rebuild and re-add/replace the framework with the new version and it should work.
Are you using Carthage and have multiple XCode_s on your machine? I had an issue recently when I ran
carthage update --use-ssh --platform iOS while xcode8.3.3 was selected in the command line. Then included built frameworks into the build.
For it to work in XCode9 you will need to run switch command
sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer for your Xcode.app and run carthage again.
Hope it helps.
Had the same problem. I'm using Xcode 9.2, Swift 4 and my device runs in iOS 11.1.
Solution:
I deleted Apple Worldwide Developer Relations Certificate Authority in Keychain Access and replace it with a new one (you can download certificate here)
After that, I have changed "Trust"(double-click the certificate) from "Always Trust" to "System Default".
Try restarting Xcode. I tried everything else and this is what stopped the problem.
It mainly occurs if your certificate trust settings is set to "Always Trust". Change it to "System Defaults" and recreate the build. This should solve the issue: https://egeek.me/2017/10/21/code-signing-blocked-mmap-on-ios-device/
I faced the same problem (on Xcode 9.4.1) but couldn't solve it with any of the help. I faced a problem where Xcode kept on prompting me to use my keychain but couldn't complete the request—although I gave my password. The app built successfully and installed. However, it crashed upon running on the device immediately.
Here's what solved my issue.
Deleted my Certificate & public/private key pair
Created a new Certificate (via a CSR) and installed it on my computer
Linked the new certificate to the provisioning profile and installed the profile on Xcode
Cleaned the build and deleted the existing build on the device
Hurray!!!
Hope this helps someone who is searching through the planet!
Just clean and built solve this problem. Tested in Xcode 9.2 and Swift 4

error: Invalid bitcode version (Producer: '800.0.35.0_0' Reader: '703.0.31_0')

When I try to Archive my application on Xcode 7.3.1, I am getting following error:
error: Invalid bitcode version (Producer: '800.0.35.0_0' Reader:
'703.0.31_0') clang: error: linker command failed with exit code 1
(use -v to see invocation)
I was able to successfully Archive my app yesterday, can any one please help me?
i had this error before ...
you may try the following solution it worked for me
search for bitcode keyword in app --> Build Settings and change it to NO
then archive again -->
it should work fine now
Install Xcode 8:
https://developer.apple.com/download/
Xcode 8 GM seed may be used to submit apps to the App Store.
More info:
In my case I updated to the latest Facebook iOS SDK 4.15.1. Since that library was updated with Xcode 8 and I was still using Xcode 7.3.1 it caused the error.
https://developers.facebook.com/docs/ios/change-log-4.x
Updated for Xcode 8 GM and iOS 10.
So, double check 3rd party libraries.
Or if you don't mind disabling bitcode:
Go to build settings search bitcode and change "Enable Bitcode" to "No".
I also faced the same problem, and as suggested by #Nate,
the issue was because of a third party SDK integrated in our project using Cocoapods.
To help me figure out which one of the 15 pods i had in the project was responsible, i did the following:
Create a new xcode project
Copy the Podfile from your original project to the newly created project's directory
Do pod install
Remove one or more of the pods⋆
Archive the new project, and see if it succeeds, if not repeat step 4 till you are able to archive
⋆(you can also try something like binary search, wherein you delete the first half pods in your Podfile and see if the new project archives)
Once you've figured out the library causing the issue, keep downgrading the library by explicitly specifying the version in Podfile, until the project archives successfully.
And then you can use that version of the library to archive and upload to the app store.
If you are using lib or pod that mean that one of them built by a higher version of your current Xcode, you can either update your code or return back to the previous version where the pods were built by your current version.
If you ran pod update check the pods updated if you ran pod install check the dates of the pods comparing to the release date of your Xcode that will will lead you to the responsible pod.
I got it while I was building using Xcode 8.2.1 and the pod built by Xcode 8.3.1
I also faced this error: Invalid bitcode version (Producer: '800.0.24.1_0' Reader: '703.0.31_0') I have googling so many but unable to find the proper solution. I tried Myself and solved this probable
In my case this error occurs after adding FBSDK by drag and drop that we all usually do.
You can resolve this problem by following these steps:
Delete all pod script in build Phases.
Delete the dragged FBSdks file from the project.
Exit xcode and delete 3 things "Pod folder","Podfile.lock" and "Projectworkspace"
Search and add FBSDK pod link in podfile
Install the pod again by using terminal.... now open Xcode archive your project build.
good solutions, but disabling bitcode worked for some people.
edit :- it worked for me too.
but in future your app might be in problem or (build not optimised by Appstore) if your project is **Bitcode Disable **.
Bitcode is an intermediate representation of a compiled program. Apps you upload to iTunes Connect that contain bitcode will be compiled and linked on the App Store. Including bitcode will allow Apple to re-optimize your app binary in the future without the need to submit a new version of your app to the store.
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
So thats why try to figure out error solutions right way.
The error basically says:
The static linker could not correctly link a certain bitcode bundle, which was
produced using Producer: '902.0.39.2', and is being read using Reader:
'900.0.37'.
You can look up at https://gist.github.com/yamaya/2924292 to identify the Xcode versions for the corresponding compiler versions. In the current case, the reader (our Xcode version) is Xcode 9.0, whereas the producer (Xcode version of typically a third party SDK) is Xcode 9.4. The incompatibility between the two is the root cause of this issue.
You may either:
turn off the bitcode as discussed in other answers, or
roll-back the SDK to a previous version that worked well, or
update your codebase to use the newer Xcode version.

How to update Fabric & Crashlytics?

I installed Fabric and crashlytics framework using fabric app and not cocoapods.
I needed to update it to comply with this error and for the future.
/Crashlytics.framework/Crashlytics(CrashlyticsPlaceholderStatic.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 arm64
and I've read that the update will fix the issue.
Thanks!
Mike from Crashlytics and Fabric here.
If you updated to Crashlytics 3.3.1 and Fabric 1.5.1, then those frameworks support Bitcode enabled app. Release notes here.
Go to Build Settings(target's), find the
'Enable Bitcode' key under 'Build options'
Set it's value to NO.
REASON: iOS9 has this option from Xcode 7, By default it is set as YES(I guess). Since, third party frameworks like Crashlytics doesn't updated for bitcode enabled mode. So, set it NO.
To add to the other solutions:
Fabric was not recognizing that my project had an outdated Crashlytics version. It listed my "Installed" version as 3.3.4 when infact it was v3.0.x.
I clicked "Install" on Crashlytics and was prompted to rebuild project. But the project rebuild was failing due to the Bitcode being enabled and my Crashlytics.framework version being outdated.
I disabled Bitcode, and successfully built, at which point Fabric updated my Crashlytics. THereafter, I was able to turn Bitcode back on and continue to build successfully with Crashlytics v3.3.4
I solved this problem this way:
Build settings -> Build Options -> Enable Bit = NO
Build app
Fabric notifies that I have to update Crashlytics framework, so I have built app to update framework
Build settings -> Build Options -> Enable Bit = YES
And everything works fine now.

Resources