Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Flutter run on Xcode but don't on VS Code

Tags:

xcode

ios

flutter

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"
like image 281
Gerson Flores Acuña Avatar asked Mar 25 '26 09:03

Gerson Flores Acuña


2 Answers

These steps work fine

  1. run "flutter clean"
  2. on flutter project in xcode -> build -> clean
  3. run "flutter build bundle"
like image 196
V.Cunha Avatar answered Mar 26 '26 22:03

V.Cunha


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.

like image 23
Rick Avatar answered Mar 26 '26 21:03

Rick