XCode 12.0.1 and 12.1 Do not build universal applications - macos

Using XCode 12.0.1 or 12.1 on MacOS 10.15.7 on a MacBook Pro, I cannot get my Mac OS application to compile for the arm64 architecture (i.e. make a Universal application). My project has evolved through many many many XCode versions, so I thought maybe it was corrupted somehow.
So, I created a new non-document-based app project in XCode. I then edited the scheme for Run to build for Release. The default build settings included the arm64 archtecture, and "Build Active Archtecture Only" set to NO for Release. I then set the tool bar scheme setting to buid for "Any Mac", built the project and looked at the build log. It built only for the x86_64 architecture.
Apple's documentaton says it should build for both architectures with these settings. What am I missing?

The problem is Apple's documentation, whoch clearly says XCode 12 builds universal. It does not, as of this writing, you MUST use the xcode 12 BETA.

I've had older Xcode-Projects that just wouldn't build universal binaries. It was due to a VALID_ARCHS user defined variable in one of the build settings (at the very bottom of the list). Once removed, universal binaries were created.

Related

XCode 12.3 building for iOS Simulator, but linking in dylib built for iOS, couchbaselite framework for architecture arm64 Using M1 Chipset

Encountered a build issue on IOS too with "building for iOS Simulator, but linking in dylib built for iOS, file '.../platforms/ios/Pods/CouchbaseLite/iOS/CouchbaseLite.framework/CouchbaseLite' for architecture arm64"
I currently using nativescript 6.5.3 and cocoapod 1.10.
Using M1 chipset.
Since Xcode is a Universal Application, You can make Xcode to use the intel based logic even in the m1 mac mini for a quick fix and then try to find the cause and fix it if you can:
Quit Xcode.
Right-click on Xcode.app (the application itself! NOT the one in the dock and NOT the project file)
Select Get info.
Select "Open using Rosetta" or "Open using Rosetta 2"
Launch Xcode and Run your project.
Go to TARGET (e.g. Runner in my screen, not the PROJECT), then Build Settings
Search for excluded like in screenshot.
Edit the field in Architectures > Excluded Architectures, to add arm64. You can double click the top line to edit all 3 lines below.
Rebuild/ run
My details: Running on M1 mac mini, with a flutter iOS project.

How to specify Mac OSX deployment target for dependencies in Mac Catalyst when previewing

When trying to preview a Mac Catalyst app I run into an isue:
The package product 'NIOTransportServices' requires minimum platform version 10.15 for the macOS platform, but this target supports 10.10 (in target 'NIOTSHTTPServer' from project 'swift-nio-transport-services')
When building a preview the build system seems to not respect the deployment target set.
Obviously, as this is an IOS project with Mac as extra target the MACOSX_DEPLOYMENT_TARGET variable is set to 10.15
Building and running the app works fine.
Is there a way of manually specifying the deployment target for preview builds?
As it turned out this was a bug in Xcode and is fixed since 12.0.1 and later.

Xcode OSX SDK is more current than my OS

I am running OSX 10.10.5.
When I create a new Xcode command line project for OSX, the Base SDK is for 10.11. This doesn't seem to matter, as I can still run and archive and use the command line tool.
Today I used CMake to generate an Xcode project from a third-party library. When I open it, it also shows a Base SDK for 10.11. However, unlike my little command-line tool, when I run it, I get the message:
However, there are no other SDKs shown when I inspect the Xcode.app SDK directory, nor are there other options in the Base SDK field in Xcode.
My 2-part question:
1) Why does my own command-line tool not do this, but this third-party Xcode project does, when both have the same SDK listed?
2) How can I get a 10.10.5 SDK into my Xcode, or can't I?
The relevant setting is not the SDK, which governs the maximum level of features your app can use. It's the deployment target, which governs the minimum OS supported by your app.
Your App_HelloWorld target is apparently configured with a deployment target of 10.11. Change that to 10.10 or, perhaps, earlier. However, you have to be careful to either avoid any APIs that require a later version of the OS or do run-time checks before using any APIs newer than your deployment target to make sure they are available.
You can set the deployment target in the target General settings or the project Info settings.

XCode5 says missing SDK 10.7, but I only refer to 10.8

I just installed OS X 10.8 and XCode 5 and I am trying to build a project. I changed the base SDK and Deployment target both to 10.8 and I get this error.
I can't find any reference to 10.7 in my settings, any ideas?
Xcode typically only ships with one SDK for each platform (e.g. Xcode 5 supports iOS 7 & MacOS 10.9 SDK; and at this precise moment it also has MacOS 10.8's SDK built in but probably not for much longer), so in my own settings I typically refer to "Latest SDK" (whichever is shipping with the installed version of Xcode).
And then you can reset "minimum deployment version" in your project settings to be the actual minimum MacOS version (10.5, 10.6, 10.7) you want to run on.
Now, if you do NOT see references to "10.7" in your settings, you may need to actually look at the raw XML of your "project.pbxproj" which resides within your Xcode project. You can look at it in a text editor and see if it's referring to 10.7 anywhere unexpected within it.

What's the recommended XCode to build PPC/Tiger binaries?

I have an older PowerPC iMac G4 running 10.4 Tiger for which I want to develop an application. I do have a much never Intel Mac Pro currently running 10.8 (and I still have 10.6 and 10.7 installation DVDs) which I could use as the machine to write the code.
I've never done anything with XCode (C# developer by trade), so I'm looking for the path of least resistance/configuration requirement:
Run XCode 2.5 on the PPC Mac running 10.4 - SLOW!
Run XCode 4/5 on my Intel Mac running 10.8 - Can I compile for 10.4/PPC without spending a week setting compiler parameters that I don't understand?
Install 10.6 on my Mac and run XCode 3.2.6 - a lot of extra setup work and an outdated XCode version
Use Xamarin Studio - doesn't do PPC?
The App eventually needs to run on PPC, Intel and iOS, although I'm fine with having separate projects and only a single shared code base.
If this were me, I'd buy an external drive, install a clean copy of MacOS 10.6 on that and then Xcode 3.2.6, which is the last version of Xcode that officially supports PPC development.
You then set your "MINIMUM_DEPLOYMENT_TARGET" for your project to 10.4. You'll also set the supported architectures to i386 & ppc.
The more interesting challenge will be to try to get the same project to build both iOS & Macintosh targets.

Resources