Yesterday I started to get strange error message from iTunes Connect:
ITMS-90668
Invalid Bundle Executable.
The executable file '...' contains incomplete bitcode.
To compile binaries with complete bitcode, open Xcode and choose Archive in the Product menu.
Actually, I am getting many identical messages for each of my embedded frameworks.
I do use Bitcode, and I have not changed anything related Bitcode in my project.
It seems like a new ITMS requirement (or bug). And I have no idea how to fix it.
Looks like this problem mysteriously related to CI tools like Shenzhen or BuddyBuild. Or, maybe, it is related to cases when dependencies contain precompiled code.
Just in case, my app:
Has these dependencies which have precompiled code:
BuddyBuildSDK, Firebase, CardIO.
Written in Swift.
Has iOS Keyboard Extension.
Use BuddyBuild.
Use CocoaPods.
Update:
I had changed virtually nothing and then the problem did disappear yesterday. I have no idea why exactly. I believe Apple just fixed that bug or it is fluke problem.
I had the same problem with some pod dependencies. I changed "Enable Bitcode" build setting for each pod projects causing the issue (following the error descriptions from itunesconnect). Now everything works.
You can set it in the Podfile. Here an example that changes for each dependencies:
post_install do |installer|
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['ENABLE_BITCODE'] = 'NO'
end
end
end
Found here: Disable bitcode for project and cocoapods dependencies with Xcode7?
Just register a problem in the git card.io library:
https://github.com/card-io/card.io-iOS-SDK/issues/205
I hope to resolve this situation as soon as possible!
Related
This error has been stopping me progress with my project for a while now and nothing seems to be working for me.
I have added A pod to my swift project but when I try to import it into my app, I get this error:
Could not find module 'ImagePicker' for target 'x86_64-apple-ios-simulator'; found: arm64, arm64-apple-ios-simulator
I've searched far and wide and tried almost all the solutions and still nothing seems to be working.
I'm using the latest Xcode.
is there anything I need to do fix this as this is stopping me from building the app.
I have the same issue on the M1 laptop.
Have you tried this solution:
post_install do |installer_representation|
installer_representation.pods_project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['ONLY_ACTIVE_ARCH'] = 'NO'
config.build_settings['BUILD_LIBRARY_FOR_DISTRIBUTION'] = 'YES'
end
end
end
Alternatively, you can change default scheme to Release, instead of Debug, by going to the top menu Product -> Scheme -> Edit Scheme, select your Run scheme as Release.
However, better solution would be to simply make sure you're running Xcode using Rosetta. Simple do the Get Info on the Xcode icon, from there in popup window make sure that Open using Rosetta is checked
I'm using SPM for dependency management and ran into issues with my M1 laptop.
I had Excluded architectures within the top level project build settings set to arm64, which is where I ran into the problem
After I removed that it worked.
Here's a screenshot of the Architectures section in the Project build settings, after making the change (ignore dark mode look, I was switching laptops).
I get an error when I try to archive my react native app using release configurations in Xcode - Target 'yoga' (libyoga.a)
error: Multiple commands produce '/Users/mat/Library/Developer/Xcode/DerivedData/ListadoV1-ghytgthpajfllcakinpdoknnalbr/Build/Intermediates.noindex/ArchiveIntermediates/ListadoV1/IntermediateBuildFilesPath/UninstalledProducts/iphoneos/libyoga.a':
1) Target 'yoga' has a command with output '/Users/mat/Library/Developer/Xcode/DerivedData/ListadoV1-ghytgthpajfllcakinpdoknnalbr/Build/Intermediates.noindex/ArchiveIntermediates/ListadoV1/IntermediateBuildFilesPath/UninstalledProducts/iphoneos/libyoga.a'
2) Target 'yoga' has a command with output '/Users/mat/Library/Developer/Xcode/DerivedData/ListadoV1-ghytgthpajfllcakinpdoknnalbr/Build/Intermediates.noindex/ArchiveIntermediates/ListadoV1/IntermediateBuildFilesPath/UninstalledProducts/iphoneos/libyoga.a'
How to resolve this in the new build system?
[Update 20190926: If you upgrdae react-native 0.60+, which is cocoapods native, this sort of thing should never happen and the workaround I posted below should not be necessary]
If I may make some assumptions, you are using react-native (libyoga is referenced), you are using the new build system from XCode 10+ (not the legacy system) and you have integrated CocoaPods (likely to use Firebase or similar).
Please correct me if I am wrong, but that's my setup, and that's what produced this error for me.
You have three options in increasing order of effort and correctness.
First, you can get moving this moment with no effort by just ignoring/hiding the problem by switching your build to the Legacy Build System[1]:
1. In Xcode, go to File->Project/Workspace settings.
2. Change the build system to Legacy Build system.
Second, you can get moving with the new XCode build system with a little effort if you add a workaround snippet[2] in your Podfile until the problem is fixed upstream in react-native or Cocoapods. I am doing this now and my project successfully archives:
post_install do |installer|
installer.pods_project.targets.each do |target|
# The following is needed to ensure the "archive" step works in XCode.
# It removes React & Yoga from the Pods project, as it is already included in the main project.
# Without this, you'd see errors when you archive like:
# "Multiple commands produce ... libReact.a"
# "Multiple commands produce ... libyoga.a"
targets_to_ignore = %w(React yoga)
if targets_to_ignore.include? target.name
target.remove_from_project
end
end
end
(then as #jules-randolph points out - you must run a pod install in your iOS folder to start using the Podfile changes you made)
Third, you can do the work to completely convert your project to Pods by removing any left over references to react-native frameworks in your project (as opposed to the workspace configred by Pods).[3]. I have not done this yet but it is the correct thing to do and closed the upstream issue.
References, and note the parent issue in general is useful
[1] https://github.com/facebook/react-native/issues/20492#issuecomment-422958184
[2] https://github.com/facebook/react-native/issues/20492#issuecomment-409599358
[3] https://github.com/facebook/react-native/issues/20492#issuecomment-464343895
I just got this error when submitting an app to the app store.
Does this mean I need to set ENABLE_BITCODE for all dependencies? I tried that but then got errors saying the dependencies were not compatible with bitcode (or something like that)...
I had the same problem earlier this morning. In fact the answer is in the error : "Verify that all of the targets for a platform have a consistent value for the ENABLE_BITCODE build settings"
I had a target (with ENABLE_BITCODE set to NO), using multiple pods having ENABLE_BITCODE set to YES. So, all I had to, do is set ENABLE_BITCODE to YES in my project target. But I guess you have a choice, you can also set ENABLE_BITCODE to NO in all the libs your are using.
The easiest and most common fix:
You can uncheck "Include Bitcode" when submitting the app via Xcode.
If you use xcodebuild, you can use pass an exportOptionsPlist with the value of uploadBitcode set to false. In my case, we're using xctool to build the app and don't have the ability to pass an exportOptionsPlist, so we had to remove bitcode from all of our frameworks.
If anyone is using cocoapods and wants to disable bitcode for their frameworks, you can just add the following to your podfile:
post_install do |installer|
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['ENABLE_BITCODE'] = 'NO'
end
end
end
Via https://stackoverflow.com/a/32685434/1417922
To add a little more clarification as to what's going on with this issue:
It seems that apple just started enforcing this yesterday. If your main binary has bitcode disabled, but you include a static library or framework that has bitcode enabled, it will fail validation. It goes the other way too: if your main binary has bitcode enabled, but you include a library/framework that has bitcode disabled, it will fail validation.
I had a few dependencies from GoogleMaps and Amazon that made it non trivial to switch everything to enable bitcode, so I simply disabled it and removed bitcode from one static library I had imported in my project. You can strip bitcode from any binary by using this following command
$ xcrun bitcode_strip -r {Framework}.dylib -o tmp.dylib
$ mv tmp.dylib {Framework}.dylib
https://developer.apple.com/library/content/documentation/Xcode/Conceptual/RN-Xcode-Archive/Chapters/xc7_release_notes.html
While the above are solutions to the problem, I don't agree that if the main binary has bitcode disabled that all of the included binaries should need it as well. Bitcode is just some IR code that Apple can use for app thinning--why don't they just strip it from other binaries (which I assume is what they previously did)? This doesn't make a ton of sense to me.
Apple thread https://forums.developer.apple.com/thread/48071
I just unchecked "include bitcode" and it started to upload
For Carthage
Open your libraries in your project folder (Carthage->Checkouts->[lib name])
Then open each lib in Xcode
Set Enable Bitcode - No in build settings
Do it for each lib in your list
Build carthage carthage build --platform xxx
Then you can archive and submit to the Appstore successfully
We were getting same error "Xcode - Error ITMS-90635 - Invalid Mach-O in bundle - submitting to App store" from last friday (3-june-2016) .. used the below mentioned 2 steps to get this done
Step 1:
Added code to pod file to mark 'ENABLE_BITCODE' = 'NO' in pods
post_install do |installer|
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['ENABLE_BITCODE'] = 'NO'
end
end
end
Step 2:
Marked 'ENABLE_BITCODE' = 'NO' in pods for the project
Note: Tried with marking 'ENABLE_BITCODE' = 'YES' in pods and in my project too but as we are using twillio framework for calling which has a flag -read_only_relocs which does not allow compilation with 'ENABLE_BITCODE' = 'YES'. So if your app does not use any of such framework with -read_only_relocs then you can proceed with making 'ENABLE_BITCODE' = 'YES' as it will be good for your app.
For those who are having build error after setting "Enable BitCode" to Yes.
I have to update all the library.But,the easiest part is I use Cocoapods.So,please update all your pod project : (One by one) or All
Then set Enable BitCode to "No" before you archive.
Then Archive>>Upload>>It will pass this error.
Cheers.
I had the same issue with project "ENABLE_BITCODE = YES" and dependencies "ENABLE_BITCODE = YES" on my CI with Xcode 7.3.
Solution was updating Xcode to latest available version (7.3.1)
I just got this error when submitting an app to the app store.
Does this mean I need to set ENABLE_BITCODE for all dependencies? I tried that but then got errors saying the dependencies were not compatible with bitcode (or something like that)...
I had the same problem earlier this morning. In fact the answer is in the error : "Verify that all of the targets for a platform have a consistent value for the ENABLE_BITCODE build settings"
I had a target (with ENABLE_BITCODE set to NO), using multiple pods having ENABLE_BITCODE set to YES. So, all I had to, do is set ENABLE_BITCODE to YES in my project target. But I guess you have a choice, you can also set ENABLE_BITCODE to NO in all the libs your are using.
The easiest and most common fix:
You can uncheck "Include Bitcode" when submitting the app via Xcode.
If you use xcodebuild, you can use pass an exportOptionsPlist with the value of uploadBitcode set to false. In my case, we're using xctool to build the app and don't have the ability to pass an exportOptionsPlist, so we had to remove bitcode from all of our frameworks.
If anyone is using cocoapods and wants to disable bitcode for their frameworks, you can just add the following to your podfile:
post_install do |installer|
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['ENABLE_BITCODE'] = 'NO'
end
end
end
Via https://stackoverflow.com/a/32685434/1417922
To add a little more clarification as to what's going on with this issue:
It seems that apple just started enforcing this yesterday. If your main binary has bitcode disabled, but you include a static library or framework that has bitcode enabled, it will fail validation. It goes the other way too: if your main binary has bitcode enabled, but you include a library/framework that has bitcode disabled, it will fail validation.
I had a few dependencies from GoogleMaps and Amazon that made it non trivial to switch everything to enable bitcode, so I simply disabled it and removed bitcode from one static library I had imported in my project. You can strip bitcode from any binary by using this following command
$ xcrun bitcode_strip -r {Framework}.dylib -o tmp.dylib
$ mv tmp.dylib {Framework}.dylib
https://developer.apple.com/library/content/documentation/Xcode/Conceptual/RN-Xcode-Archive/Chapters/xc7_release_notes.html
While the above are solutions to the problem, I don't agree that if the main binary has bitcode disabled that all of the included binaries should need it as well. Bitcode is just some IR code that Apple can use for app thinning--why don't they just strip it from other binaries (which I assume is what they previously did)? This doesn't make a ton of sense to me.
Apple thread https://forums.developer.apple.com/thread/48071
I just unchecked "include bitcode" and it started to upload
For Carthage
Open your libraries in your project folder (Carthage->Checkouts->[lib name])
Then open each lib in Xcode
Set Enable Bitcode - No in build settings
Do it for each lib in your list
Build carthage carthage build --platform xxx
Then you can archive and submit to the Appstore successfully
We were getting same error "Xcode - Error ITMS-90635 - Invalid Mach-O in bundle - submitting to App store" from last friday (3-june-2016) .. used the below mentioned 2 steps to get this done
Step 1:
Added code to pod file to mark 'ENABLE_BITCODE' = 'NO' in pods
post_install do |installer|
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['ENABLE_BITCODE'] = 'NO'
end
end
end
Step 2:
Marked 'ENABLE_BITCODE' = 'NO' in pods for the project
Note: Tried with marking 'ENABLE_BITCODE' = 'YES' in pods and in my project too but as we are using twillio framework for calling which has a flag -read_only_relocs which does not allow compilation with 'ENABLE_BITCODE' = 'YES'. So if your app does not use any of such framework with -read_only_relocs then you can proceed with making 'ENABLE_BITCODE' = 'YES' as it will be good for your app.
For those who are having build error after setting "Enable BitCode" to Yes.
I have to update all the library.But,the easiest part is I use Cocoapods.So,please update all your pod project : (One by one) or All
Then set Enable BitCode to "No" before you archive.
Then Archive>>Upload>>It will pass this error.
Cheers.
I had the same issue with project "ENABLE_BITCODE = YES" and dependencies "ENABLE_BITCODE = YES" on my CI with Xcode 7.3.
Solution was updating Xcode to latest available version (7.3.1)
I've got a share extension set up for my app and I'm using AFNetworking through a cocoapods install.
I was able to build and run the app through simulator and my phone via debug builds but when I tried to archive to submit to the app store I ran into a warning:
linking against dylib not safe for use in application extensions
AFNetworking
Archive builds would complete but they would be corrupted and unusable.
My solution is to stop using cocoapods for my app extension and manually add the AFNetworking files to my Compile Resources build setting.
I'm just wondering if others have had this issue OR if they have had no problems using AFNetworking cocoapod to submit an extension to the store.
I have checked out the Apple Guidelines and was using arm64 architecture and had set the target’s “Require Only App-Extension-Safe API” build setting to Yes.
As far as i know the latest version of cocoapods should set automatically "Allow app extension API only" flags to all libs targets if pods library is properly linked to extension target(s) (check targets from Pods.xcodeproj). If it doesn't happen you can try to set it manually in post_install hook. You can try this one:
post_install do |installer_representation|
installer_representation.project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['APPLICATION_EXTENSION_API_ONLY'] = 'YES'
end
end
end