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, 就能正常运行了。

相关文章
|
7月前
|
Java 网络安全 Maven
简记:一个flutter构建错误A problem occurred configuring project ‘:smart_auth‘. > Could not res
简记:一个flutter构建错误A problem occurred configuring project ‘:smart_auth‘. > Could not res
427 0
|
4月前
|
Dart Android开发
Android Studio New里面没有New Flutter Project
Android Studio New里面没有New Flutter Project
164 1
Android Studio New里面没有New Flutter Project
|
4月前
|
存储 JSON 数据格式
解决使用flutter_intl出现警告No @@locale or _locale field found in intl_en
解决使用flutter_intl出现警告No @@locale or _locale field found in intl_en
84 2
|
4月前
|
开发工具 Android开发
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
169 2
|
4月前
|
API
Flutter 解决Type ‘MouseCursor‘ not found.
Flutter 解决Type ‘MouseCursor‘ not found.
48 0
【错误记录】Flutter 使用 MediaQuery 适配全面屏报错 ( No MediaQuery widget ancestor found. )
【错误记录】Flutter 使用 MediaQuery 适配全面屏报错 ( No MediaQuery widget ancestor found. )
872 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 )
398 0
【错误记录】Flutter 界面报错 ( No MediaQuery widget ancestor found. | Scaffold widgets require a MediaQuery )
|
Dart 开发工具
【错误记录】Flutter 构建报错 ( Error: Method not found: ‘CupertinoModalPopupRoute‘. | 下载最新 Flutter SDK 版本 )
【错误记录】Flutter 构建报错 ( Error: Method not found: ‘CupertinoModalPopupRoute‘. | 下载最新 Flutter SDK 版本 )
239 0
【错误记录】Flutter 构建报错 ( Error: Method not found: ‘CupertinoModalPopupRoute‘. | 下载最新 Flutter SDK 版本 )
|
API 开发工具 Android开发
【错误记录】Flutter / Android 报错 ( AAPT: error: attribute android:requestLegacyExternalStorage not found )
【错误记录】Flutter / Android 报错 ( AAPT: error: attribute android:requestLegacyExternalStorage not found )
722 0
【错误记录】Flutter / Android 报错 ( AAPT: error: attribute android:requestLegacyExternalStorage not found )
flutter No Material widget found.
flutter No Material widget found.
307 0