Flutter run出现No Provisioning Profile was found for your project‘s Bundle Identifier or your device

简介: Flutter run出现No Provisioning Profile was found for your project‘s Bundle Identifier or your device

出现场景

Flutter中,使用flutter run运行debug模式, 等待xcode build完成后,在install时出现以下错误。

Launching lib/main.dart on iPhone in debug mode...
Automatically signing iOS for device deployment using specified development team in Xcode project: DD2AWWF43G
Running Xcode build...
Xcode build done.                                           85.0s
Installing and launching...
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.io/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打开ios/Runner.xcworkspace,检查了签名设置都是正常的,使用xcode 直接run是能正常运行起来的,只是使用flutter run无法正常运行。所以应该是Flutter中有签名缓存,导致打包时使用的以前的签名。

  1. flutter clean
    在flutter项目目录中,使用flutter clean清理缓存.
  2. xcode clean build

使用xcode打开ios目录,选择菜单栏中的Product->Clean Build Folder.

clean完成后,会出现以下提示

3.flutter build bundle
最后在flutter项目目录下运行flutter build bundle,重新生成ios app的二进制文件。

再次运行flutter run, 就能正常运行了。

目录
打赏
0
2
2
0
54
分享
相关文章
简记:一个flutter构建错误A problem occurred configuring project ‘:smart_auth‘. > Could not res
简记:一个flutter构建错误A problem occurred configuring project ‘:smart_auth‘. > Could not res
722 0
Android Studio New里面没有New Flutter Project
Android Studio New里面没有New Flutter Project
322 1
Android Studio New里面没有New Flutter Project
解决使用flutter_intl出现警告No @@locale or _locale field found in intl_en
解决使用flutter_intl出现警告No @@locale or _locale field found in intl_en
231 2
Flutter: Android SDK not found at this location,Android Studio not found at xxx
Flutter: Android SDK not found at this location,Android Studio not found at xxx
333 2
|
11月前
|
API
Flutter 解决Type ‘MouseCursor‘ not found.
Flutter 解决Type ‘MouseCursor‘ not found.
96 0
【错误记录】Flutter 使用 MediaQuery 适配全面屏报错 ( No MediaQuery widget ancestor found. )
【错误记录】Flutter 使用 MediaQuery 适配全面屏报错 ( No MediaQuery widget ancestor found. )
910 0
【错误记录】Flutter 使用 MediaQuery 适配全面屏报错 ( No MediaQuery widget ancestor found. )
【错误记录】Flutter 界面报错 ( No MediaQuery widget ancestor found. | Scaffold widgets require a MediaQuery )
【错误记录】Flutter 界面报错 ( No MediaQuery widget ancestor found. | Scaffold widgets require a MediaQuery )
446 0
【错误记录】Flutter 界面报错 ( No MediaQuery widget ancestor found. | Scaffold widgets require a MediaQuery )
【错误记录】Flutter 构建报错 ( Error: Method not found: ‘CupertinoModalPopupRoute‘. | 下载最新 Flutter SDK 版本 )
【错误记录】Flutter 构建报错 ( Error: Method not found: ‘CupertinoModalPopupRoute‘. | 下载最新 Flutter SDK 版本 )
291 0
【错误记录】Flutter 构建报错 ( Error: Method not found: ‘CupertinoModalPopupRoute‘. | 下载最新 Flutter SDK 版本 )
【错误记录】Flutter / Android 报错 ( AAPT: error: attribute android:requestLegacyExternalStorage not found )
【错误记录】Flutter / Android 报错 ( AAPT: error: attribute android:requestLegacyExternalStorage not found )
787 0
【错误记录】Flutter / Android 报错 ( AAPT: error: attribute android:requestLegacyExternalStorage not found )
flutter No Material widget found.
flutter No Material widget found.
341 0
AI助理

你好,我是AI助理

可以解答问题、推荐解决方案等

登录插画

登录以查看您的控制台资源

管理云资源
状态一览
快捷访问