Flutter run on Xcode but don't on VS Code

I'm trying to run my app in a real iOS device within VS Code but I'am having an error about provisioning profile, I already set my provisioning profile to automatic and also set my development team, everything works in Xcode but not in VS Code.

Here is the error:

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- In the 'General' tab, make sure a 'Development Team' is selected. 
    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.

For more information, please visit:
 https://flutter.dev/setup/#deploy-to-ios-devices

Or run on an iOS simulator without code signing
════════════════════════════════════════════════════════════════════════════════
2020-01-09 10:18:45.163 ios-deploy[43201:5238881] [ !! ] Error 0xe8008015: A valid provisioning profile for this executable was not found. AMDeviceSecureInstallApplication(0, device, url, options, install_callback, 0)
Could not install build/ios/iphoneos/Runner.app on 2fd298b64f27b47f0917050a9f7ec70cdc98f033.
Try launching Xcode and selecting "Product > Run" to fix the problem:
 open ios/Runner.xcworkspace

Xcode version 11.3

I already check automatically manage signing

enter image description here


SOLUTION

  1. run "flutter clean" on flutter project
  2. in xcode -> build -> clean
  3. run "flutter build bundle"

Upvotes: 11

Views: 18700

Answers (5)

PRATHIV
PRATHIV

Reputation: 570

  1. Trust the developer
  2. Open Settings > Developer
 ,Click on Clear trusted computer
 and Then trust this computer
  3. Add the test device to your Apple developer test device list. (Enable Automatic signing )

Upvotes: 0

Sharon A
Sharon A

Reputation: 2655

I had the same issue and solved it with these steps:

  1. Delete the app from your iPhone
  2. Open Xcode -> click Product -> Clean Build Folder (see screenshot)
  3. Open VScode terminal and run command flutter clean && flutter run xCode Product>Clean Build Folder

Upvotes: 2

Prashant Vaddoriya
Prashant Vaddoriya

Reputation: 615

if you are running your code in real device. That error will we occur. I have solved this issue by add the test device to your apple developer test device list.

Upvotes: 2

Rick
Rick

Reputation: 2271

I'm not using my mac right now, so I can't give you exact instructions; but please try opening your app with Xcode, and look for the provisioning profile, and try to use automatically manage signing.

If I remember correctly it should be at general > signing. You might have to click the target, or the runner somewhere at the left side of Xcode. Then try to run your app via VS Code again after doing the changes.

Upvotes: 3

V.Cunha
V.Cunha

Reputation: 157

These steps work fine

  1. run "flutter clean"
  2. on flutter project in xcode -> build -> clean
  3. run "flutter build bundle"

Upvotes: 14

Related Questions