What does The destination does not support the architecture means? - xcode

I have the same problem with Xcode Cannot Run on the Selected Destination
The destination does not support the architecture for which the
selected software is built. Switch to a destination that supports that
architecture in order to run the selected software.
I tried the solutions there and it doesn't work.
So I'll try to do something more reasonable.
What does the error means anyway? What is Xcode trying to say when it says to switch to a destination that supports that architecture? Where is the archtecture specified? What software? What is the problem?
While solutions may be nice what I am looking for is understanding of what it really means.
The project used to work
The project still work in real iPhone but not simulator
I used the newest facebook SDK. However, it run before even after the SDK. It's after I clean project it doesn't work.

While I don't have a solution for your problem, I can answer your question, namely, what does Xcode thinks is wrong and what does the error means.
So, the destination is actually your simulator in this case (could be the iPhone as well, if you're building for it). The architecture is decently explained here. What you need to understand is that in order for a software to run on a specific architecture it needs to be build for it(or assembled for it, to be more precise). That means that for the same software the CPU instructions are not the same for an iPhone (which has an ARM CPU) as they are for your iMac (which is x64).
Now, with the above in mind, what Xcode is trying to say is that you are trying to build the wrong architecture for your simulator and you should switch to a different destination that supports that architecture (as you mentioned, you can build just fine on the iPhone, which is a different architecture) in order for the software to run.
It could be an Xcode bug or a misconfiguration. You're probably better off creating a new project and copy all your classes into it than hunting it down.

You'll be happy to know this problem has a very simple solution. Select Info.plist in your project navigator tree and make sure it is not assigned to a target. I have confirmed this is the correct solution. If building for iOS 6 or earlier you may also need to add armv6 to supported architectures

Related

Is Bazel good for mobile+desktop project?

I am looking for a relible build system for my ongoing cross-platform c++ project.
It's meant to be IOS (Obj-C (SWift?) + c++), Android (Java (Kothlin?) + cpp via NDK/Jni bridge) app, and probably osx and windows as well.
Although it's highly likely that desktop platforms are meant to be a 'development' platforms only (not production ones).
I considered gradle, but it didn't look like the best solution for ios and/or desktop platforms.
Of course, there is well known and well-proven cmake, but I personlly don't like it. I haven't had any experience with cmake on Android, and want to try something new and modern at the moment.
Bazel (https://docs.bazel.build/versions/master/tutorial/cpp.html) looks promissing for me, but I am wondering how hard it might be to create 4 native project from one codebase/project structure.
In other words, I want to create one common make file for the 4 different platforms. When changes is going to be made, I'd like to make them only once and get all my four build working.
I believe, I understand platform dependant staff. The question is about possibility to have 1 common project for 4 different platforms.
Is it feaseble to acheive this with Bazel?
Or you could reccommend anything else either?
I think Bazel is the perfect solution for you. Take a look at this repository.
Take a look on chapter_9 (Android app) and chapter_10 (iOS app).

Which Xamarin ABIs should we support

Currently our Xamarin Android app (PCL) is huge in my opinion, even in release mode. I suspect it is due to supported architectures. Currently we have them all selected. Does anyone know if we have to select all of these? We are not using the Android NDK at all as well.
I will copy part of my answer from here.
Make sure you are at least checking the following architectures: armeabi-v7a and x86. You could do the other three but we do not since we use LLVM compiling in release mode, which is not compatible with the 64 bit architectures (except for armeabi, which is deprecated). The good thing about that is that all of the 64 bit architectures can still use 32 bit builds so they all still get covered if you check those 3.
So I would just check those 3 unless you have a specific reason to check the other ones. We have had 0 problems installing our app on devices using those 3 only.
On a side note, turning on LLVM compiling and optimizing your icons/images will help with the final APK size.
*Edit: Since writing this we ran into a bug only on certain devices (Android Nexus 9) which leads to app crashes when launching the app. The solution is to check the arm64-v8a architecture. This will probably increase app size so weigh the pros and cons and see how much of a difference it makes in your APK size after including the architecture or split your APK for each architecture if necessary.
No you do not have to select all of them. You can create an .apk per ABI if you wanted to to reduce the size of your .apk. Note: The encouraged method is that you develop and publish a single .apk. However this is not always practical, and sometimes it's better to create separate ones. Although this answer only goes into depth about different CPU Architectures (ABI), you could also create different .apk for screen size, device features, and API levels.
https://developer.xamarin.com/guides/android/advanced_topics/build-abi-specific-apks/
http://developer.android.com/google/play/publishing/multiple-apks.html
I would recommend grabbing a tool like WinDirStat(https://windirstat.info/) or Disk Inventory X(http://www.derlien.com/) to investigate why your .apk is so large. You might find other reasons why your .apk is large such as resources(images, raw files), assemblies, etc.

MonoTouch to XCode Export

I am bidding on a project where the client wants the mobile app delivered in an XCode project as that they can sign it.
Can I build in MonoTouch, then "Export" to Xcode so that I can deliver that to the client?
My experience is that I can build in MonoTouch in roughly 1/2 the time as I can in Xcode. Mostly due to MonoTouch.Dialog and C#'s framework sugar.
I am using MonoTouch Enterprise 5 and MonoDevelop 2.8
I think a lot depend on the definition of "export to Xcode" and I encourage you to clarify this with your client.
If the technical requirement is simply to sign the application the know that the code signing step, done with MonoDevelop (or with the mtouch command-line tool), is simply calling the codesign tool which is provided by Apple. That step is applied on a fully built .app (directory) so anyone should be able (with the right certificates/keys) to sign it (as long as the .plist data match).
There is also some support to (in mtouch) to build an Xcode project (see --xcode option) that could prove useful. This is something you can (and should) try to ensure it can as is match your (client) requirements.
Finally there could be ways to create a dumb Xcode projects that could be used only to copy and sign files. I'm pretty sure that would be possible with VS.NET/msbuild and MonoDevelop/makefiles - but I don't know Xcode well enough to say if that's a possibility.
Conclusion: the only thing I really don't doubt is that you can make this with MonoTouch[.Dialog]/C# in half the time than other solutions ;-)

iOS: 4.2 or lower must include ARM6 object code? [duplicate]

In iOS5 Apple drops the armv6 architecture from the ARCHS_STANDARD_32_BIT.
In order to keep the support for iPhone3G I still want to compile in armv6 even in iOS5.
Did anyone find a solution for this?
I just built something today specifying a deployment target of iOS 4.0. With only armv7 specified in Architectures, Xcode warned me that to support anything below iOS4.2 I had to include armv6 in Architectures. Just edit that field, click the "+" button when the dialog pops up and enter the literal "armv6".
In my case, we want our app to work under iOS4 and iOS5. We had to make some modifications so it would work correctly under iOS5, but all those changes were done with iOS4-friendly code changes.
We also added some iOS5-specific capabilities in a manner that allows the app to run without crashing under iOS4. Specifically, we tested for iOS5 capabilities before trying to use them, and linked iOS5-only libraries as Optional.
So, supporting iPhone3G in an iOS5 world could just as easily mean "we want our app to run on iOS4 and above (regardless of any iOS5 feature use)" rather than "we want to make sure our app runs on an older device running iOS5". There's a difference here; think about it. :-)
Anyway, adding armv6 support back in is very easy. And I guess the point is this: At some point, when there are no more armv6 devices out there to worry about (for whatever reason) you won't have to build for it. Apple's view is everyone should upgrade to the latest hardware as soon as possible. So in that world, there is no need for the tools to default to anything but the latest and greatest too. :-) Fortunately (or not), we developers live in the real world and recognize that you have to support older stuff for a while. And I guess the Xcode dev team knows this too, which is why you can add armv6 support back in quite simply.
The simple answer is that you have to change the current settings from "Standard (armv7) - $(ARCHS_STANDARD_32_BIT)" to just be "armv6" and "armv7". See the image below. You have to delete the line with the previous settings for it to work.
also make sure you set this in Project AND Targets ... cost me an hour to figure that out. had set it for one but not the other. hope this helps. GLTA
I think there's a reason why Apple dropped armv6 from the standard setting.
I have compiled armv7/armv6 with iOS5 SDK, however, the armv6 compiler produced wrong code in release mode. After hours of finding a workaround (trying llvm or gcc with different optimization levels) I give up.
So, I am going back to iOS SDK 4.x as long as I support older armv6 devices.
Example of code:
// myView center=(160, 100)
CGPoint p=myView.center;
// now p=(100,100) (what the heck?)
p.x=myView.center.x;
p.y=myView.center.y;
// now p=(160,100)
p.y+=100;
// now p =(200,200) (what the heck?)
Maybe I'm have some memory corruption, however, on the armv7 compiler and on iOSSDK < 5.0 it behaves as expected.
Best regards
Not sure if this is actually a solution yet, but I have discovered that replacing the defined string in "architectures", which was $(ARCHS_STANDARD_32_BIT), with "armv6 armv7" allowed me to compile with iOS5 as a base and iOS4 as a deployment target, and pass validation .
I am not using any IOS5-exclusive libraries or calls, but intend to in my next release.
I did not need to replace $(ARCHS_STANDARD_32_BIT) with just armv7 for the app to compile and be uploaded to the App Store.
As suggested by MarkGranoff, I simply added armv6 as plain text, by hitting plus and just typing it in on line two.

Xcode "Run With Performance Tool" disabled?

I am trying to find memory leaks from my Xcode project. I don't know, what happened - I can't select anything from Run->Run with performance tool - the list of things are disabled.
Please help me, I am a beginner.
The problem was i have deleted the build folder and was trying to run with performance tool, without building the code again, if you need to test your app with performance tool, you must compiled your code, and you need to have build folder in your project.
I believe you are building an iOS program. As said by Apple engineers, most items under Run with Performance Tool need dTrace support, but dTrace is not available for iOS yet, not even for simulators.

Resources