Invalid Bundle. Your binary, {Bundle name}, has a 64-bit architecture slice - swift

ERROR ITMS-90502: "Invalid Bundle. Your binary, '{Bundle id}', has a 64-bit architecture slice, so you must include the "arm64" value for the UIRequiredDeviceCapabilities key in your Xcode project. Learn more (https://developer.apple.com/library/content/documentation/General/Reference/InfoPlistKeyReference/Articles/iPhoneOSKeys.html#//apple_ref/doc/uid/TP40009252-SW3)."
I keep getting this error every time I try to upload a version to the store, note that it includes the iMessage extension.
I try all the solutions:
Change Build Active Architecture Only to yes
Setting Required device capabilities for all targets.
Also in Xcode, it shows that it really supports arm64!
Xcode version 13.0

I have fixed this issue by adding
UIRequiredDeviceCapabilities armv7 arm64
to Info.plist to all targets

Related

Xcode 11 - Adding New Target For Apple Watch

I have created a new Target for Apple Watch in new Xcode 11. But After creating it I am getting the following error.
No architectures to compile for (ARCHS=i386, VALID_ARCHS=armv7s arm64 armv7).
Solved :
I got mine to compile by resetting Valid Architectures in the watchkit extension to $(ARCHS_STANDARD) which converts to armv7k. Seemed to work for me so far.

Xcode 5 and iOS 7: Architecture and Valid architectures

I'm starting new project in Xcode 5. I want to develop application using iOS SDK 7 but with deployment target iOS 5.0. As soon as I create new project in Xcode and try to change deployment target to 5.0, I've got this message:
Applications including an arm64 slice are not compatible with versions of iOS
prior to 6.0
Adjust your Architectures build setting to not include arm64 in order to deploy
to releases prior to iOS 6.0.
So changed architectures to Standard (no 64bit). I compiles, runs but I do not really understand what just happend.What's the difference between Architectures and Valid architectures settings in Xcode project Build Settings?If I set Architectures to exclude 64-bit what happens when I run my app on 64-bit iPhone or iOS Simulator (I know it works, I'm just curious what hapens underneath)?Can you explain big mess with new 64-bit architecture?
Set the architecture in build setting to Standard architectures(armv7,armv7s)
iPhone 5S is powered by A7 64bit processor. From apple docs
Xcode can build your app with both 32-bit and 64-bit binaries included. This combined binary requires a minimum deployment target of iOS 7 or later.
Note: A future version of Xcode will let you create a single app that supports the 32-bit runtime on iOS 6 and later, and that supports the 64-bit runtime on iOS 7.
From the documentation what i understood is
Xcode can create both 64bit 32bit binaries for a single app but the
deployment target should be iOS7. They are saying in future it will
be iOS 6.0
32 bit binary will work fine in iPhone 5S(64 bit processor).
Update (Xcode 5.0.1)
In Xcode 5.0.1 they added the support to create 64 bit binary for iOS 5.1.1 onwards.
Xcode 5.0.1 can build your app with both 32-bit and 64-bit binaries included. This combined binary requires a minimum deployment target of iOS 5.1.1 or later. The 64-bit binary runs only on 64-bit devices running iOS 7.0.3 and later.
Update (Xcode 5.1)
Xcode 5.1 made significant change in the architecture section. This answer will be a followup for you.
Check this
My understanding from Apple Docs.
What is Architectures (ARCHS) into Xcode build-settings?
Specifies architecture/s to which the binary is TARGETED. When specified more that one architecture, the generated binary may contain object code for each of the specified architecture.
What is Valid Architectures (VALID_ARCHS) into Xcode build-settings?
Specifies architecture/s for which the binary may be BUILT.
During build process, this list is intersected with ARCHS and the resulting list specifies the architectures the binary can run on.
Example :- One iOS project has following build-settings into Xcode.
ARCHS = armv7 armv7s
VALID_ARCHS = armv7 armv7s arm64
In this case, binary will be built for armv7 armv7s arm64 architectures. But the same binary will run on ONLY ARCHS = armv7 armv7s.
When you set 64-bit the resulting binary is a "Fat" binary, which contains all three Mach-O images bundled with a thin fat header. You can see that using otool or jtool. You can check out some fat binaries included as part of the iOS 7.0 SDK, for example the AVFoundation Framework, like so:
% cd /Developer/Platforms/iPhoneOS.platform/DeviceSupport/7.0\ \(11A465\)/Symbols/System/Library/Frameworks/AVFoundation.framework/
%otool -V -f AVFoundation 9:36
Fat headers
fat_magic FAT_MAGIC
nfat_arch 3
architecture arm64 # The 64-bit version (A7)
cputype CPU_TYPE_ARM64
cpusubtype CPU_SUBTYPE_ARM64_ALL
capabilities 0x0
offset 16384
size 2329888
align 2^14 (16384)
architecture armv7 # A5X - packaged after the arm64version
cputype CPU_TYPE_ARM
cpusubtype CPU_SUBTYPE_ARM_V7
capabilities 0x0
offset 2359296
size 2046336
align 2^14 (16384)
architecture armv7s # A6 - packaged after the armv7 version
cputype CPU_TYPE_ARM
cpusubtype CPU_SUBTYPE_ARM_V7S
capabilities 0x0
offset 4407296
size 2046176
align 2^14 (16384)
As for the binary itself, it uses the ARM64 bit instruction set, which is (mostly compatible with 32-bit, but) a totally different instruction set. This is especially important for graphics program (using NEON instructions and registers). Likewise, the CPU has more registers, which makes quite an impact on program speed. There's an interesting discussion in http://blogs.barrons.com/techtraderdaily/2013/09/19/apple-the-64-bit-question/?mod=yahoobarrons on whether or not this makes a difference; benchmarking tests have so far clearly indicated that it does.
Using otool -tV will dump the assembly (if you have XCode 5 and later), and then you can see the instruction set differences for yourself. Most (but not all) developers will remain agnostic to the changes, as for the most part they do not directly affect Obj-C (CG* APIs notwithstanding), and have to do more with low level pointer handling. The compiler will work its magic and optimizations.
You do not need to limit your compiler to only armv7 and armv7s by removing arm64 setting from supported architectures.
You just need to set Deployment target setting to 5.1.1
Important note: you cannot set Deployment target to 5.1.1 in Build Settings section because it is drop-down only with fixed values. But you can easily set it to 5.1.1 in General section of application settings by just typing the value in text field.
Simple fix:
Targets -> Build Settings -> Build Options -> Enable Bitcode -> No
Works on device with iOS 9.3.3
None of the answers worked and then I was forgetting to set minimum deployment target which can be found in Project -> General -> Deployment Info -> Deployment Target -> 8.0

OpenCV.Framework does not compile for the armv7s architecture

I am working on an iphone application using openCV framework.
Everything was working fine. however lately with the release of iOS 6 and XCode 4.5 I was migrating my project to XCode 4.5
When building I encountered this error:
ld: file is universal (2 slices) but does not contain a(n) armv7s
slice:
/Users/jobs/iPhone_Client/workspace/MyProject/third-party/OpenCV.framework/OpenCV
for architecture armv7s clang: error: linker command failed with exit
code 1 (use -v to see invocation)
** BUILD FAILED **
The following build commands failed:
Ld build/MyProject.build/Debug-iphoneos/MyProject.build/Objects-normal/armv7s/MyProject
normal armv7s (1 failure)
As I understood this is due to the new armv7s architecture.
OpenCV is apparently it is not compiling with armv7s.
How can I fix this issue?
Where can I find a new release of the framework that is compatible with the armv7s architecture?
And if there is no compatible framework available, is there a way to get the source code and create my own library compiled against the new architecture? Maybe some quick steps on how to do it?
Note: Just to note that I need the build for armv7s not armv7.
Thank you
This answer builds upon the one given by n9986. As he suggested, I cloned the repository found at
https://github.com/jonmarimba/OpenCV-iOS
When I downloaded it several references inside the project to different libraries were broken which was strange but they were easy to fix. After they were fixed it behaved exactly as n9986 described, outputting libraries compiled for both armv7 and armv7s. For my purposes however I required that they be bundled into a .framework so that they could be a drop in replacement for the old .framework I have been using.
Previously I had downloaded the latest version of Opencv for ios here and spent quite a bit of time trying to modify their cmake files to compile with support for armv7s. jonmarimba has already restructured the xcode project file to strip away its cmake dependencies which makes changing the target architecture much more intuitive. Unfortunately he does not build as many libraries as come with the standard openCV build. I added a new target to jonmarimba's project for opencv_world which is the target used in the standard openCV release for converting into a framework. Once that was built I used it as a drop in replacement for the static library in the framework file structure generated by the standard openCV release.
The framework I created can be downloaded here. It works perfectly for me as a drop in replacement for my previous opencv2.framework. I did notice however that jonmarimba has not converted the targets for opencv_videostab, opencv_stitching, or opencv_nonfree. It is possible that if you use one of those libraries my framework will not work for you. If that is the case let me know and I can try to set those up as targets in the xcode project for you.
Update
To compile for other architectures, change the target architecture in the included xcode project to whatever you like for the opencv_world library. After you build it, go find the library you just built. Rename the opencv_world library to opencv2 and replace the library file found in the .framework with opencv_world.
Update2
OpenCV 2.4.3 now compiles with armv7s support by default so these solutions are outdated.
Clone the Xcode project for opencv and update the opencv git submodule as per the README:
https://github.com/jonmarimba/OpenCV-iOS
Check the build settings, make sure iOS6 and armv7s are present. Click build. You should now have the armv7s compatible .a files. I just tried this:
$ file libopencv_core.a
libopencv_core.a: Mach-O universal binary with 2 architectures
libopencv_core.a (for architecture armv7): current ar archive random library
libopencv_core.a (for architecture cputype (12) cpusubtype (11)): current ar archive random library
The last entry is for armv7s as per my research so far.
Edit: The last entry is indeed armv7s. I ran the Xcode's own lipo info command:
$ xcrun -sdk iphoneos lipo -info libopencv_core.a
Architectures in the fat file: libopencv_core.a are: armv7 armv7s
You can always just not target armv7s, and only target armv7. Your application will still run fine on the iPhone 5, it just won't be fully optimized for the new instruction set.
Simply, I cloned source from here and build with this tutorial.
Then I got opencv2.framewok that works with armv7, armv7s and simulator.
Stating the obvious, you will need to recompile and rebuild the library openCV.framework and target it for armv7s.
Adjust the library "project settings" and "target settings" before rebuild. good luck!
Probably its possible to build it with CMake. I had one year ago a problem with a medical library I wanted to build for iOS. I could handle that with CMake.
Perhaps this link can be a starter.
http://computer-vision-talks.com/2010/12/building-opencv-for-ios/
Good luck!
Pass -DCMAKE_OSX_ARCHITECTURES="armv6;armv7;armv7s;i386" to cmake when compiling OpenCV library/framework for iOS.

Error on Xcode - Warning: all apps should include an armv7 architecture (current ARCHS = "")

I'm constantly getting following error while building app.
The error is:
Check dependencies
No architectures to compile for (ARCHS=armv7, VALID_ARCHS=arm6 arm7).
warning: all apps should include an armv7 architecture (current ARCHS = "").
How can I resolve this? I'm using Xcode 4.3.1.
In your TARGET'S Build Settings look into "Build Active Architecture Only" set Debug to "NO" and Release to "NO"
This happened with my app when I had my iPhone connected to my Mac.
When I disconnect it and archive again selecting iOS Device it was OK.
In your target's Build Settings there is a setting called "Architectures", which is probably empty. Add "armv7" and/or "armv6" to it.
My problem was i wrote "armv7, armv7s", just remove the quote "," and it works ok.

xcode invalid archive in organizer

i get message during archive validation. i've tried most of solutions from other questions. but still failed. (It was ok when i submit it last time in xcode 4.02, then i get rejected. i edited some image and .m file(not project settings).
my project Build settings:
Architectures->standard (armv7) - $(ARCH_STANDARD_32_BIT)
Base sdk->Latest ios(ios 5.0)
valid Architectures armv6 armv7 arvm7f armv7k
Build active architecture only->no
ios deployment target: ios3.0
i've tried reinstalling xcode and make sure unix is checked, 5 times.
i've tried install back to xcode 4.02, but the same message as xcode 4.2
i've tried reinstall cocos2d
i've tried to set the llvm/gcc to gcc only
warning message 1:
Project Clean-Up Outdated settings should be updated.
when i click it. one is to set gcc to llve-gcc, another is to 'Enable compiler warning for missing Function Prototypes. ' I clicked cancel
warning message 2:
Check dependencies
[BWARN]warning: iPhone apps with a deployment target lower than 4.3 should include an armv6 architecture (current IPHONEOS_DEPLOYMENT_TARGET = "4.1", ARCHS = "armv7").
warning 3:
Validate /Users/lifesucks/Library/Developer/Xcode/DerivedData/FishvsBirdsLite-frctqlpldaogcjebgvxkvvmsehie/ArchiveIntermediates/FishvsBirdsLite/InstallationBuildProductsLocation/Applications/FishvsBirdsLite.app
cd "/Users/lifesucks/my app/Fish vs Birds/FishvsBirdsLite"
setenv PATH "/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"
setenv PRODUCT_TYPE com.apple.product-type.application
/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/Validation /Users/lifesucks/Library/Developer/Xcode/DerivedData/FishvsBirdsLite-frctqlpldaogcjebgvxkvvmsehie/ArchiveIntermediates/FishvsBirdsLite/InstallationBuildProductsLocation/Applications/FishvsBirdsLite.app
2011-06-14 01:30:10.948 Validation[8609:607] *** Warning: Defaulting to the standard codesign tool
warning: iPhone/iPod Touch: application executable is missing a required architecture. At least one of the following architecture(s) must be present: armv6 (-19033)
Unable to validate your application. - (null)
warning: There is no codesign_wrapper executable. Please reinstall the Xcode developer tools. (-19058)
Unable to validate your application. - (null)
the error message in organizer is:
the archive is invalid. /var/folders/H5/.../app.ipa does not exist.
I actually don't know why, but it works now. I reinstall back to xcode 4.0.2. then recreated a project, copied over all my classes. i assume that the problem is 'Architectures->standard (armv7)', in xcode 4.0.2 the Architectures is standard armv6/armv7, maybe it's because of cocos2d compatibility to the new version i don't know. anyway if you encounter the same problem, just install back to non-beta and create a new project (since the original setting of 'Architecture' will be modified to 'armv7 standard'. ) hope it helps.
This happened to me when I updated to Xcode 4.2. I went back to the latest non-Beta Xcode version to fix it. The key is, when uninstalling Xcode, you must do it via the following command in Terminal:
sudo /Developer/Library/uninstall-devtools –mode=all
This takes a few minutes. But when it's done, install the non-Beta Xcode (4.0.2 at this time), and then RESTART before using it. Worked for me.
Remove iphoneossimulator from supported platforms for the distribution/release build configuration. That is if you have it.
You cannot have that for distribution, it is only for your debug configurations.
Check the image below for distribution configuration (ignore release config).