【问题标题】:Failed to install the requested application: The bundle identifier of the application could not be determined. - Flutter无法安装请求的应用程序 - Flutter
【发布时间】:2022-01-24 06:10:14
【问题描述】:

我在 Xcode 模拟器中启动我的颤振应用时遇到问题。该应用程序的 android 版本在使用 android 模拟器进行测试时运行良好,即使在成功构建应用程序时也没有出现任何错误,但我不知道 Xcode 出了什么问题。 (IOS版)

颤振版本:v2.5.3 |开发工具:v2.8.0

错误日志:(颤振运行)

Unable to install /Users/USER_NAME/Documents/APP_NAME/main_files/source/wordpress_app/build/ios/iphonesimulator/Runner.app on FEBE8117-5EC5-429F-820D-DA1F80359C7B. This is sometimes caused by a
malformed plist file:
ProcessException: Process exited abnormally:
An error was encountered processing the command (domain=NSPOSIXErrorDomain, code=22):
Failed to install the requested application
The bundle identifier of the application could not be determined.
Ensure that the application's Info.plist contains a value for CFBundleIdentifier.
  Command: /usr/bin/arch -arm64e xcrun simctl install FEBE8117-5EC5-429F-820D-DA1F80359C7B
  /Users/USER_NAME/Documents/APP_NAME/main_files/source/wordpress_app/build/ios/iphonesimulator/Runner.app
Error launching application on iPhone 11.

感谢您提供的任何帮助。

【问题讨论】:

  • 该错误表明您的Info.plist 文件存在问题。你能分享一下你的Info.plist 文件是什么样子的吗?
  • 当然,这里是:pastebin.com/pVhNRn8h
  • 不要尝试对您的 CFBundleIdentifier 进行硬编码,尝试使用 <key>CFBundleIdentifier</key><string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
  • 亲爱的,我不需要用我的 iOS 包名替换 CFBundleIdentifier 值吗?
  • PRODUCT_BUNDLE_IDENTIFIER 应该设置为你的 iOS 包名。不要在Info.plist 文件中手动设置CFBundleIdentifier

标签: xcode flutter dart


【解决方案1】:

在您的 Info.plist 文件中,替换:

<key>CFBundleIdentifier</key>
<string>$(com.MY_NAME.MY_APP_NAME)</string>

与:

<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>

【讨论】:

  • 我还有错误!!
【解决方案2】:

问题是在 Info.plist 中不包含有效的 CFBundleVersion。确保您的捆绑包包含有效的 CFBundleVersion。

您需要将代码粘贴到列表文件中

CFBundleVersion $(FLUTTER_BUILD_NUMBER)

【讨论】:

  • 我的 CFBundleVersion 看起来像这样:imgur.com/ZD5YC8H
  • 那么,我将 CFBundleVersion 值替换为 $(FLUTTER_BUILD_NUMBER)?
猜你喜欢
  • 2020-04-07
  • 1970-01-01
  • 2018-12-07
  • 1970-01-01
  • 1970-01-01
  • 2020-11-28
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多