Xcode 12 Upload ERROR ITMS-90085: "No architectures in the binary. Lipo failed to detect any architectures in the bundle executable." - ios

I am working on an app I've published numerous times before. I recently updated to Xcode 12 and am using the Carthage workaround script, which enables me to build Debug builds without problem. When I try to upload an archive to App Store Connect, though, I see this error:
App Store Connect Operation Error
ERROR ITMS-90085: "No architectures in the binary. Lipo failed to detect any architectures in the bundle executable."
I looked around in the xcarchive and can see that in the .app directory, my non-carthage embedded library's directory does not have a unix executable, whereas past successful xcarchive uploads do have that executable.
Any thoughts on how to fix this? Going back to Xcode 11.7 would require changing the app code, so I'm hoping to not have to do that.
Update: Did also try removing and re-embedded the framework in question, but that didn't help.
I finally added a build phase run script that fixes this issue, but will continue to look for a better solution. Anyway here's the script I added --
MISSING_FRAMEWORK_EXECUTABLE="${PROJECT_TEMP_ROOT}/UninstalledProducts/iphoneos/MyFramework.framework/MyFramework"
TO_DIRECTORY="${BUILT_PRODUCTS_DIR}/${FRAMEWORKS_FOLDER_PATH}/MyFramework.framework/"
mkdir -p "${TO_DIRECTORY}"
cp "${MISSING_FRAMEWORK_EXECUTABLE}" "${TO_DIRECTORY}"

Remove POD folder and do Pod install again.
It worked for me , i hope it will work for you as well.

Related

Xcode 14.0 Command PhaseScriptExecution failed

After updating Xcode to 14.0 (and accompanying Xcode Command Line Tools), and building my application as I normally would, I'm running into the error you see above. This is a pretty well documented error, but I've tried every solution I've been able to find:
Investigating Keychain settings
Running pod deintegrate and pod install
Cleaning the build folder
Logging off and shutting everything down and turning things back on / logging back in
Entering arm64 as an excluded architecture and subsequently removing it from the .xcworkspace
Combinations of all the above
Ensuring all the Pods I have are not out of date.
I'm at a loss. Your input is greatly appreciated. Thank you.
As it turns out, there was a file generated as part of the build process (I don't know exactly what) with some flag set that I didn't think I needed, so I just deleted it and rebuilt the app. No issues there.
Solution: it helps to comb through staged commits to see if there's anything created that simply isn't needed, and to delete those files ad hoc.

Archive Export error: The archive contains nothing that can be signed

My app runs on devices and simulators. The app archives with no errors. When I try to export I get the following error:
The log file IDEDistribution.critical.log contains the following:
2017-07-07 07:40:03 +0000 [MT] Failed to generate distribution items with error: Error Domain=IDEDistributionErrorDomain Code=12 "The archive contains nothing that can be signed." UserInfo={NSLocalizedDescription=The archive contains nothing that can be signed., NSLocalizedRecoverySuggestion=Verify that your build process has compiled binaries and copied in bundled resources.}
2017-07-07 07:40:03 +0000 [MT] Presenting: Error Domain=IDEDistributionErrorDomain Code=12 "The archive contains nothing that can be signed." UserInfo={NSLocalizedDescription=The archive contains nothing that can be signed., NSLocalizedRecoverySuggestion=Verify that your build process has compiled binaries and copied in bundled resources.}
The contents of the .xcarchive:
The .app also contains all the usual stuff.
I am sure there may be more information needed. Please ask and I will provide what I can.
What fixed my issue was including arm64 in the app architecture,
In your Target -> Build Settings search for:
VALID_ARCHS and make sure arm64 is included.
search for Excluded Architectures and make sure arm64 is NOT mentioned there.
Change the archive destination directory to a location on the local SSD (and not an external HDD).
I have not had this problem again after I did this and I recall having started running into the problem after I started trying to free up space on my mac.
At last! There may have been other issues too, but only after I changed the scheme container was I able to export. And I knew it had something to do with CocoaPods.
Before pod install your scheme may look something like this:
There are no other container options.
After pod install it will look like this:
Once I selected the Workspace container I started seeing a difference in the build and consequently the export worked.
For me helped relaunching an Xcode. I think the problem is because all archives stored in a separate HDD and it was something with the access to it by Xcode.
I had similar error when I was resolving error occurred after shifting from Intel based mac to M1 based mac for a ReactNative based project. For resolving some fixes, I had to exclude the arm64 in the project build settings, but I also excluded it in the target. I removed the "arm64" from all schemes of the excluded targets of Excluded Architectures of the project target and rebuilt the code. It worked.

How to solve Xcode compile warning: "when processing... in... no such file or directory"?

When I build in Debug schema, I see no warnings, but in Release I get 2 warnings:
while processing /Users/[path to my xcode project]/libUserVoice.a(UserVoice.o):
warning: /var/folders/s_/m1fjy19n3_x5tnr4pfvx_z1c1111gp/C/com.apple.DeveloperTools/7.0-7A218/Xcode/SharedPrecompiledHeaders/UserVoice_Prefix-cemskxhozggatlabrcxqvydduxjw/UserVoice_Prefix.pch.pch: No such file or directory
while processing /Users/[path to my xcode project]/libUserVoice.a(UserVoice.o):
warning: /var/folders/s_/m1fjy19n3_x5tnr4pfvx_z1c1111gp/C/com.apple.DeveloperTools/7.0-7A218/Xcode/SharedPrecompiledHeaders/UserVoice_Prefix-axbllcwdvmtdfsgaozoqlvgidayx/UserVoice_Prefix.pch.pch: No such file or directory
In fact there is no such directory as /var/folder/s_.
I think I this is the first release build since update to Xcode 7.3.
What did not help so far:
Cleaning build folder
Restarting Xcode
Removing files in ~/Library/Developer/Xcode/DerivedData/
Removing files in ~/Library/Caches/com.apple.dt.Xcode/
Removing folders and files in all folders /var/folders/.../SharedPrecompiledHeaders
What I observed:
The Xcode parameter Precompiled Headers Cache Path points to a different directory /var/folders/ck/...
What is the reason for these warnings?
OK what finally helped was:
Removing the library libUserVoice.a mentioned in the warning
Getting the source code from github and rebuilding the library
Adding the newly built library
When I removed the new library and replaced it with the old one the warnings appeared again. The old one is a compiled binary that is provided by the vendor. So it seems this has nothing to do with Xcode but with the vendor's build. Still, if anyone can shed light on this issue it would be interesting to know the background.
Hint: Make sure to build the library as a universal binary so it can run on both ARM (iOS device) and i386 (iOS Simulator) architectures.

'Found an uxexpected Mach-O header code: 0x72613c21' when trying to export an archive to IPA.

So I recently had this issue when deploying to my device:
(null): error: bitcode_strip /Users/me/Library/Developer/Xcode/DerivedData/AppName-gximcjgdoodczthglfujqgpzamxl/Build/Products/Debug-iphoneos/Pods.framework/Pods: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/bitcode_strip exited with 1
I didn't encounter this error when deploying to a simulator though.
I found a solution here which says that I should set a user defined attribute 'STRIP_BITCODE_FROM_COPIED_FILES' to no.
Since then, I now get "Found an uxexpected Mach-O header code: 0x72613c21" when trying to export an archive.
Before the bitcode_strip issue, I was having no problem exporting archives so I'm wondering if the fix caused the current issue I'm facing, or if perhaps they are unrelated? If they are unrelated, what could actually be causing this?
here is the verbose IDEDistribution log
critical distribution log
standard distribution log
I have the same issue. I solved the problem when:
Uninstall cocoapods (I had installed cocoapods 0.39):
sudo gem uninstall cocoapods
Install cocoa pods 0.38.2:
sudo gem install cocoapods -v 0.38.2
For me, I went to TARGETS > General > Embedded Binaries
and removed my embedded binary (which was grey instead of yellow and happened to be Realm.framework)
Archive and submitted to iTunes then worked.
I wonder if it is because I had the Realm.framework embedded binary, but hadn't included the realm header or used realm yet - so maybe the compiler 'tried optimize away' my framework?

xcodebuild failure clang:error no such file or directory:

Having a problem when building with xcodebuild. My project/app builds fine with the Xcode - gui. It simply isn't finding/building the libcryptopp library which is part of the build process.
The error is:
clang: error: no such file or directory: '/Users/builder/repo/ioskpay/xcode-cryptopp/cryptopp/build/Release-iphoneos/libcryptopp.a'
This particular file should be derived from another project inside the main app - xcodebuild simply isn't correctly pointing at the right file folder which should be:
~/Library/Developer/Xcode/DerivedData
Any ideas?
To fix this, go to your project settings, go to Targets and select your main project target. Then go to Build phases. Under Target dependencies add the static library project.
This way, when you compile the main project, the static library subproject gets compiled before the main project and your static library will be available.
I had the same problem, but for a resource file .m
I opened target -> build phases -> Compile sources
and I found the file the compiler was tell it can't find duplicated: one with strange icon and the other with a normal icon. I simply removed the one with strange icon and it worked. ( I added the file multiple times and I had a merge conflict before that which made something wrong in the project file)
For your case I think you need to remove the lib from target dependencies list and add it again. This may work for you.
In Xcode Version 9.2 (9C40b) this happened when I drug a bunch of files into the project, some of which were duplicate. Rather than simply not adding the duplicates, it added them again and only the name, not the path.
In Target > Build Phases > Compile Sources each of the duplicates showed with no "...in" after them. Each one caused the clang error.
After removing all of the duplicates that Xcode collected, the project compiled and ran.
It makes you use the Project Navigator instead of managing your source files in the Finder. Then the Project Navigator can't replace duplicates like any decent file management system (ahem Finder). 🤨
My xCode info is:
I faced similar errors during xcode building projects (native swift, flutter, react native, native script) in which I got error messages related to clang compilar. Errors like:
clang-4.0: error: no such file or directory: '/Users/xxxxxxxx/Library/Developer/Xcode/DerivedData/xxxxxxxxxxxxxxx/Index/Data Store'
clang-4.0: error: cannot specify -o when generating multiple output files
others
Despite of errors related with DerivedData for native apps can be fixed by deleting the directory and, eventually, restart xCode and even restart the machine... in this case, you will see that after deleting the directory and start building process again, the error comes back.
Then, is the moment of checking the clang installation by running clang --version. The normal output will be something like:
as you can see the InstalledDir is incorrect for xCode. In my case, some days ago I needed to install Anaconda app (R, Python, etc) and, now, I remember that I had to install some dependencies and one of them was clang and its installation was altered.
To fix this problem (in my case that I will not need anaconda any more): (edited)
1.- Delete anaconda and all its dependencies (I recommend to use App Cleaner).
2.- Re-install xCode
After reinstalling xCode, if you type again clang --version, you'll get this:
More info at: https://github.com/flutter/flutter/issues/32457#issuecomment-496161092
Hopefully, this info helps some else.
Best
Ok so by simply adding the correct -target -configuration and -scheme parameters I got this to run correctly. However due to my running this in Jenkins for autobuild purposes it still doesn't work as I'd like - getting stuck in exactly the same place. It's odd because I have the exact same code being built in another job that isn't having this problem. There is no rhyme or reason for it at this point. I will keep shooting rubber bands at it and update when I have an answer...
Sometimes Xcode performs weird.
You have to find that static library project e.g.. "filename.a" under 'Link Binary With Libraries' in Build Phase and then remove it and add it again.
I had the same problem while I was archiving my target. I removed the library and the build succeeded.
For me it was because I had removed a package or pod. I ran pod install and it fixed it
Look for the missing file in the Xcode project i.e the files may be deleted or miss placed.
add the missing files to the xcode, then everything will work fine.
Run this command :
$ conda deactivate

Resources