Flutter iOS could not build the precompiled application for the device - ios

I'm trying to run my Flutter code on a real-device, but I am encountering a code signing issue. See logs.
In Xcode, the project seems to have been using using the right team identifier. I use my machine to work on various Flutter & iOS projects.
Logs
Could not build the precompiled application for the device.
════════════════════════════════════════════════════════════════════════════════
Building a deployable iOS app requires a selected Development Team with a
Provisioning Profile. Please ensure that a Development Team is selected by:
1- Open the Flutter project's Xcode target with
open ios/Runner.xcworkspace
2- Select the 'Runner' project in the navigator then the 'Runner' target
in the project settings
3- Make sure a 'Development Team' is selected under Signing & Capabilities > Team.
You may need to:
- Log in with your Apple ID in Xcode first
- Ensure you have a valid unique Bundle ID
- Register your device with your Apple Developer Account
- Let Xcode automatically provision a profile for your app
4- Build or run your project again
For more information, please visit:
https://flutter.dev/docs/get-started/install/macos#deploy-to-ios-devices
Or run on an iOS simulator without code signing
════════════════════════════════════════════════════════════════════════════════
Error launching application on Joshua’s iPhone 13.

If you've encountered this issue, it's likely that the project you just opened is using the old certs.
To make sure you're using the correct certs for your Flutter project, in the command line clear the config:
flutter config --clear-ios-signing-cert
This is going to force your Flutter app to use the new certificates.
Next, restart the terminal.
Last, make sure the Xcode project is using the provisioning profile/s.
From the Projects / left side panel of Xcode, click Runner
Under TARGETS, click Runner
Next, click Signing & Capabilities
Last, choose the correct provisioning profile/s

Related

No Provisioning Profile was found for your project's Bundle Identifier or your device

I know there are similar questions but noone of them helped. My app (iOS and Android) which I built with flutter just got 1 year old and since then somehow I get the following error in Flutter when trying to debug it on my device:
═════════════════════════════════════════════
No Provisioning Profile was found for your project's Bundle Identifier or your
device. You can create a new Provisioning Profile for your project in Xcode for
your team by:
1- Open the Flutter project's Xcode target with
open ios/Runner.xcworkspace
2- Select the 'Runner' project in the navigator then the 'Runner' target
in the project settings
3- Make sure a 'Development Team' is selected under Signing & Capabilities > Team.
You may need to:
- Log in with your Apple ID in Xcode first
- Ensure you have a valid unique Bundle ID
- Register your device with your Apple Developer Account
- Let Xcode automatically provision a profile for your app
4- Build or run your project again***
It's also possible that a previously installed app with the same Bundle
Identifier was signed with a different certificate.
═════════════════════════════════════════════
What does that mean? I changed nothing inside xcode and there is actually a development team selected. So I don't really know how to handle this error code.

Provisioning profile "iOS Team Provisioning Profile: doesn't include the currently selected device" Flutter - MacOS

I'm able to build the macOS app from Xcode and run successfully, but when I'm trying to run it from Android Studio it's giving me the following error:
Provisioning profile "mac Team Provisioning Profile: doesn't include the currently selected device"
If I go to my apple developer account I can see my device UUID there as well.
If you're on Mac M1, your device will have two UUIDs: one when Xcode / xcodebuild is running natively, the other when running under Rosetta.
To register your device ID under Rosetta:
Applications folder > Xcode > right-click > Get Info > check "Open using Rosetta"
Open app in Xcode
Runner > Runner > Signing & Capabilities > ensure "Automatically manage signing" is checked
Xcode will give you an error about the device ID not being in the provisioning profile > click the fix button
Repeat steps 3. & 4. for any extensions you might have
Xcode will add the device ID to your profile. You can now uncheck "Open using Rosetta" to have Xcode running natively again.
See also this github issue.
You can try running the project via xcode first then running it via flutter SDK. This solved the mentioned issue for me.
That has been solved by:
Deleting the provisioning profiles from the following path:
~/Library/MobileDevice/Provisioning/Profiles/
Flutter clean
Run again
EDIT
You might need to open the project from Xcode and build it from there, and don't forget the pod install command
Open your project from Xcode
Select the device that experienced the issue from the devices list.
check this
Product > Clean Build Folder
Product > Build
Then Xcode will then ask you to register the device to your developer account. Add it and run your project as normal from Flutter.
Worked for me :
Delete macos folder inside your flutter project , and then run this command :
flutter create .
it creates a new macos folder for you and you can run your project now

"To enable automatic signing, pass -allowProvisioningUpdates to xcodebuild. (in target 'Runner' from project 'Runner')" What to do?

I received this error when trying to build iOS app on a real iPhone and not on the Simulator. This was part of the error message:
To enable automatic signing, pass -allowProvisioningUpdates to xcodebuild. (in target 'Runner' from project 'Runner')
All the places I looked for help didn't have any tips.
For me the problem was that I was using a VPN on my PC when trying to build and deploy to my test device.
Solution was to just disable my VPN.
Apple might be blocking requests over a VPN when signing an App.
Navigate in your flutter folder to directory /ios/ and open Runner.xcworkspace (the white one not the blue one) in xCode.
Then in project navigator (cmd+1) select Runner and go to build settings tab called 'signing and capabilities' and manage your signing there to get the account and automatic signing set up, build from xcode (cmd+r).
Once this signing is set up and working once you're good to go, you may now start building from VSCode or Android Studio or wherever. Quit xCode and open original flutter project files.
Enjoy!

There are no accounts registered with Xcode reported during archive even though there is

Hi I am trying to build an iOS app with Cordova.
The project successfully builds but when I try to release in order to upload to TestFlight with:
sudo cordova build ios --release --device --automaticProvisioning --packageType="app-store"
Then I get the error
error: There are no accounts registered with Xcode. Add your developer account to Xcode (in target '' from project '')
error: No profiles for 'com.' were found: Xcode couldn't find any iOS App Development provisioning profiles matching 'com.'. (in target '' from project '')
But I do have an account and the appropriate certificates and profiles.
Xcode account
Debug profile
Build settings - Signing
Release Profile
I added cocoa pods that were missing. I don't know how the build was successful from Cordova cli???
Second one of my plugins in particular admit-plus was not in the latest version in the config.xml
Fixing those two and everything worked!!!!!
This is the proper "work around" to push to test flight.
1- cordova prepare ios
2- open xcode project, uncheck automatic signing (both dev & release)
3- check back automatic signing
4- select your team
5- cordova build ios
6- build your app from xcode and test on device/simulator
7- from xcode: product -> archive
8- upload your build to appstoreconnect via xcode
9- go to appstoreconnect, then from there put it in test flight

ApplicationVerificationFailed from Nativescript CLI

I am using the latest version (2.0) of the Nativescript CLI. I recently updated by iPad to iOS 9.3 from iOS 7. Prior to this upgrade, I was able to run Nativescript apps on my device using "tns run ios". Since the upgrade, I get the following error:
Error: ApplicationVerificationFailed
ErrorDescription: The bundle being installed with bundle ID org.nativescript.bluetoothdemo2 is authorized by a free provisioning profile, but apps validated by those are not allowed to be installed from this source.
I have attempted to change the bundle ID (hence the 2) and generate new provisioning profiles to no avail. I have opened the project in xCode and the "Fix It" button is not available. The project does run in xCode.
This is how I solved the same problem.
1) Opened up XCode project that Nativescript generated, tried to run it, but it failed with message that apphas to be verified on the phone itself.
2) Opened up phone General settings > Profiles and Devices Management > Developer App.
3) Verified the app.
4) Built and run app via "tns run ios --device 1" normally without any problems.
Hope it helps :)
I would recommend you try the following:
1) Remove the platform/ios by running tns platform remove ios
2) Make sure your package.json contains the correct bundleID (this will be passed to your xcode project when you build).
3) Make sure you use the same BundleID from your Apple dev-certificates.
4) Add the platform/ios by running tns platform add ios
5) Prepare & Build: tns prepare ios & tns build ios
6) Go to your .../platforms/ios folder and open the .xcodeproj or .xcworkspace
7) Go to "General" tab of you main app target and under "Identity" group make sure you have the correct BundleID and the correct Team (your Apple dev account).
8) Go to Build Settings tab and under Code Signing group the Code Signing Identity key is set to iOS Developer (your dev Certificate), and that the Provisioning Profile is set to Automatic (when publishing it will automatically choose the correct profile).
Now you can just close XCode and run the app via CLI.

Resources