Flutter ios真机调试报错Xcode couldn‘t find any iOS App Development provisioning profiles

Could not build the precompiled application for the device.

Error (Xcode): No profiles for 'com.example.jiniu' were found: Xcode couldn't find any iOS App Development provisioning profiles matching 'com.example.jiniu'. Automatic signing is disabled and unable to generate a profile. To enable automatic signing, pass -allowProvisioningUpdates to xcodebuild.

翻译大意:Xcode 找不到任何与“com.example.jiniu”匹配的 iOS 应用程序开发配置文件。 自动签名已禁用且无法生成配置文件。 要启用自动签名,请将 -allowProvisioningUpdates 传递给 xcodebuild。

但此时经过多种方法测试都不可行。

后面仔细理解,我目前并没有使用什么签名,只是当初为了mac能进行真机调试,所以在xcode上进行操作过,后面查阅资料,总结如下方法:

打开项目根目录,进入ios目录,使用Xcode打开Runner.xcodeproj

此处点击运行,提示报错。如图 Runner 1 issue处

提示Module 'shared_preferences_ios' not found

找到错误原因就好解决了,这个错误通常是由于 Flutter 项目缺少了 SharedPreferences 插件,或者该插件在 iOS 上未安装。

处理方法:

  1. 在 pubspec.yaml 文件中添加 SharedPreferences 插件的依赖:

dependencies:
  shared_preferences: ^0.5.8+4
  1. 运行 flutter pub get 命令以安装该插件。

  1. 在 iOS 项目中添加 SharedPreferences 插件的依赖,运行 pod install 命令。

如果仍然存在问题,请重新构建项目。

或者flutter三连:

flutter clean
flutter pub get
flutter run

重新连接手机并进行真机调试,OK,搞定收工睡觉。

猜你喜欢

转载自blog.csdn.net/qq_38358909/article/details/128910687