Updated to Xcode 13, get unique error code when trying to run SwiftUI app on iOS but not macOS

When I try to build my app I receive the following error:

Unable to find a profile type for platform iOS and purpose development. You may need to reinstall Xcode.

Which I promptly did, but it does not fix the issue. Neither does cleaning build folder, rebooting, restarting, etc. Anybody encountered this before?

Upvotes: 11

Views: 6615

Answers (4)

Vinod Madigeri
Vinod Madigeri

Reputation: 177

For me it was even more rudimentary. I had selected an iOS device in the Scheme to build for, and switching to My Mac (in the top-middle toolbar) resolved this cryptic error.

enter image description here

Upvotes: 0

swifthing
swifthing

Reputation: 550

I got the same problem, it was building only on simulator and not in device. This happened after I installed a new package in SPM (SwiftLint).

And this is what worked for me:

  1. Go to target
  2. Build Settings
  3. In "Build Options", set "Allow Multi-platforms Builds" to "No"

Upvotes: 8

bryceco
bryceco

Reputation: 381

I fixed this by removing "Allow Multi-Platform Builds" in Build Settings.

Upvotes: 19

Found the answer myself. Was an issue of having 'Targeted device families' in the build settings set to iPhone, Mac, iPad. Set it to just iPhone and it works again.

Upvotes: 2

Related Questions