Can't run Swift App on Mojave

I wrote a little test app which must also run on some older Macs still using macOS 10.14.6.

When I copy the app to the old Mac I get following error message:

You can’t use this version of the application “APPNAME” with this version of macOS.

You have macOS 10.14.6. The application requires macOS 10.14 or later.

It seems to be a build bug…

I use Xcode 13.3 on macOS 12.3.1.

Any clue how to solve this issue?

Which Deployment target have you defined ? Select one that fits your Mac, may be 10.13.

In "Project" and "Targets" is the target 10.14. Therefore the error message shows that OS version.

So, try and change Target to 10.13 or even 10.12. What do you get then ?

What type of Xcode project did you create? Xcode defaults to using SwiftUI for Mac App and Document App projects. SwiftUI projects will not run on macOS 10.14.

When you choose App or Document App on a Mac project and click the Next button, make sure you choose either Storyboard or Xib from the Interface menu. Choosing Storyboard or Xib will create an AppKit project. With an AppKit project you can set the deployment target to macOS 10.14 and have the app run on macOS 10.14.

It is a Xib based project and so it should run on Mojave.

Now I tried to set the target OS to macOS 10.13. It does still now work. The error message is now

You can’t use this version of the application “APPNAME” with this version of macOS.

You have macOS 10.14.6. The application requires macOS 10.13 or later.

Now I made another test:

  • New Xib-based Swift project (macOS, App).
  • Set the build target to macOS 10.14.
  • Build without any changes.
  • Copy to a Mac running Mojave.

Result: the same error message.

It seems so that the support of older macOS versions is broken in current Xcode.

You said in initial post:

I wrote a little test app which must also run on some older Macs still using macOS 10.14.6.

When I copy the app to the old Mac I get following error message:
You can’t use this version of the application “APPNAME” with this version of macOS.
You have macOS 10.14.6. The application requires macOS 10.14 or later.
It seems to be a build bug…

I use Xcode 13.3 on macOS 12.3.1.

So where is the problem ? I understand it's on the old Mac only. Here you don't use Xcode 13.3 on macOS 12.3.1. Which version of Xcode on this older Mac ?

Did you try a clean build folder ?

You created a new project. Did you do it on older Mac ?

Note: however, the error message is really unclear and even contradictory: You have macOS 10.14.6. The application requires macOS 10.14 or later.

I did several times a clean build. My development machine is a MacBook Pro M1 on Monterey and therefore I cannot use Xcode 12 anymore. I wan to copy just the application to the older Mac and not use Xcode on that machine. The test project was also created on my development machine.

Any yes: The error message is really strange.

What architectures did you build for? What is the value of the Build Active Architecture setting?

Judging by the problems you're having, it looks like you built for the active architecture only. If you click the Run button in Xcode's toolbar, Xcode is set to build a Debug build, which builds only for the active architecture. On an M1 Mac, building for the active architecture builds an app that won't run on Intel Macs. Any Mac running 10.14 isn't going to be able to run an M1 app.

If you want your app to run on both M1 and Intel Macs, take the following steps:

  1. Choose Product > Archive to build and archive this project. This will create a universal binary that runs on both M1 and Intel Macs.
  2. Open the Organizer by choosing Window > Organizer.
  3. Select your archive from the list in the Organizer.
  4. Click the Distribute App button on the right side of the Organizer.
  5. Choose Copy App as the method of distribution.
  6. Click the Next button.
  7. Choose a location to store the exported app.
  8. Click the Export button.

Now you should be able to copy the app to the older Mac and run it. You might have to bypass macOS's Gatekeeper security to launch the app because of choosing Copy App instead of Developer ID as the method of distribution.

If the app still doesn't run on the older Mac, make sure you set the deployment target for both the project and the app target. If that doesn't work, I have nothing else to suggest.

I build Universal Binary and so it should run on M1 and Intel based Macs.

Can't run Swift App on Mojave
 
 
Q