Flutter / iOS:无法确定捆绑包ID

发布于 2025-02-06 12:58:09 字数 3972 浏览 2 评论 0原文

在我的Flutter项目中,我尝试编译并运行我的应用程序。它在Android上正常工作,但由于某种原因,当我在iOS上运行应用时,我现在有以下错误:

2022-06-11 16:21:02.274 ios-deploy[42320:338779] [ !! ] [ ERROR] Could not determine bundle id.
Could not run build/ios/iphoneos/Runner.app on 00008030-001C085222DA803E.

因此,这是我检查的内容:

  • info.plist.plist:有bundle标识符带有值$(product_bundle_identifier)
  • in targets>跑步者>构建设置>包装> 具有预期值(我的软件包名称)
  • product Bundle标识符,我在targets>中 ;跑步者>一般>束标识符
  • targets>跑步者>构建设置>包装> info.plist文件,我有正确的位置:runner/info.plist
  • 我尝试了flutter Clean,无效caches&在Android Studio上重新启动,在Xcode上清洁构建文件夹,
  • 我尝试了更多清洁,如

这里.plist file:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
    <key>CFBundleDevelopmentRegion</key>
    <string>$(DEVELOPMENT_LANGUAGE)</string>
    <key>CFBundleDisplayName</key>
    <string>$(APP_DISPLAY_NAME)</string>
    <key>CFBundleExecutable</key>
    <string>$(EXECUTABLE_NAME)</string>
    <key>CFBundleIdentifier</key>
    <string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
    <key>CFBundleInfoDictionaryVersion</key>
    <string>6.0</string>
    <key>CFBundleName</key>
    <string>Wezeejay</string>
    <key>CFBundlePackageType</key>
    <string>APPL</string>
    <key>CFBundleShortVersionString</key>
    <string>$(FLUTTER_BUILD_NAME)</string>
    <key>CFBundleSignature</key>
    <string>????</string>
    <key>CFBundleVersion</key>
    <string>$(FLUTTER_BUILD_NUMBER)</string>
    <key>ENVIRONNEMENT</key>
    <string>$(ENVIRONNEMENT)</string>
    <key>LSApplicationCategoryType</key>
    <string></string>
    <key>LSRequiresIPhoneOS</key>
    <true/>
    <key>UIBackgroundModes</key>
    <array>
        <string>audio</string>
        <string>remote-notification</string>
    </array>
    <key>UILaunchStoryboardName</key>
    <string>LaunchScreen</string>
    <key>UIMainStoryboardFile</key>
    <string>Main</string>
    <key>UIStatusBarStyle</key>
    <string>UIStatusBarStyleLightContent</string>
    <key>UISupportedInterfaceOrientations</key>
    <array>
        <string>UIInterfaceOrientationPortrait</string>
        <string>UIInterfaceOrientationLandscapeLeft</string>
        <string>UIInterfaceOrientationLandscapeRight</string>
        <string>UIInterfaceOrientationPortraitUpsideDown</string>
    </array>
    <key>UISupportedInterfaceOrientations~ipad</key>
    <array>
        <string>UIInterfaceOrientationPortrait</string>
        <string>UIInterfaceOrientationPortraitUpsideDown</string>
        <string>UIInterfaceOrientationLandscapeLeft</string>
        <string>UIInterfaceOrientationLandscapeRight</string>
    </array>
    <key>UIViewControllerBasedStatusBarAppearance</key>
    <false/>
    <key>NSCameraUsageDescription</key>
    <string>NSCameraUsageDescription</string>
    <key>CADisableMinimumFrameDurationOnPhone</key>
    <true/>
</dict>
</plist>

但是,当应用程序要启动时,我仍然有错误,我不知道它来自何处,因为它在两天前就可以完美地工作。

有人知道如何解决吗?

谢谢。

In my Flutter project, I try to compile and run my app. It works fine on Android but for some reason, out of nowhere, I now have the following error when I run my app on iOS:

2022-06-11 16:21:02.274 ios-deploy[42320:338779] [ !! ] [ ERROR] Could not determine bundle id.
Could not run build/ios/iphoneos/Runner.app on 00008030-001C085222DA803E.

So here is what I checked:

  • Info.plist: there is Bundle identifier with the value $(PRODUCT_BUNDLE_IDENTIFIER)
  • In TARGETS > Runner > Build Settings > Packaging > Product Bundle Identifier, I have the expected value (my package name)
  • In TARGETS > Runner > General > Bundle Identifier, the value is set as expected (my package name)
  • In TARGETS > Runner > Build Settings > Packaging > Info.plist File, I have the correct location: Runner/Info.plist
  • I tried flutter clean, Invalidate caches & Restart on Android Studio, Clean Build Folder on Xcode
  • I tried even more cleaning as explained here

And here is my Info.plist file:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
    <key>CFBundleDevelopmentRegion</key>
    <string>$(DEVELOPMENT_LANGUAGE)</string>
    <key>CFBundleDisplayName</key>
    <string>$(APP_DISPLAY_NAME)</string>
    <key>CFBundleExecutable</key>
    <string>$(EXECUTABLE_NAME)</string>
    <key>CFBundleIdentifier</key>
    <string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
    <key>CFBundleInfoDictionaryVersion</key>
    <string>6.0</string>
    <key>CFBundleName</key>
    <string>Wezeejay</string>
    <key>CFBundlePackageType</key>
    <string>APPL</string>
    <key>CFBundleShortVersionString</key>
    <string>$(FLUTTER_BUILD_NAME)</string>
    <key>CFBundleSignature</key>
    <string>????</string>
    <key>CFBundleVersion</key>
    <string>$(FLUTTER_BUILD_NUMBER)</string>
    <key>ENVIRONNEMENT</key>
    <string>$(ENVIRONNEMENT)</string>
    <key>LSApplicationCategoryType</key>
    <string></string>
    <key>LSRequiresIPhoneOS</key>
    <true/>
    <key>UIBackgroundModes</key>
    <array>
        <string>audio</string>
        <string>remote-notification</string>
    </array>
    <key>UILaunchStoryboardName</key>
    <string>LaunchScreen</string>
    <key>UIMainStoryboardFile</key>
    <string>Main</string>
    <key>UIStatusBarStyle</key>
    <string>UIStatusBarStyleLightContent</string>
    <key>UISupportedInterfaceOrientations</key>
    <array>
        <string>UIInterfaceOrientationPortrait</string>
        <string>UIInterfaceOrientationLandscapeLeft</string>
        <string>UIInterfaceOrientationLandscapeRight</string>
        <string>UIInterfaceOrientationPortraitUpsideDown</string>
    </array>
    <key>UISupportedInterfaceOrientations~ipad</key>
    <array>
        <string>UIInterfaceOrientationPortrait</string>
        <string>UIInterfaceOrientationPortraitUpsideDown</string>
        <string>UIInterfaceOrientationLandscapeLeft</string>
        <string>UIInterfaceOrientationLandscapeRight</string>
    </array>
    <key>UIViewControllerBasedStatusBarAppearance</key>
    <false/>
    <key>NSCameraUsageDescription</key>
    <string>NSCameraUsageDescription</string>
    <key>CADisableMinimumFrameDurationOnPhone</key>
    <true/>
</dict>
</plist>

But I still have that error just when the app is about to launch, which I have no idea where it comes from since it was working perfectly just two days ago.

Does anyone know how to fix that?

Thanks.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

谁的新欢旧爱 2025-02-13 12:58:09

在XCode中打开工作区文件。从侧面面板中选择跑步者,然后选择“常规”选项卡。您应该能够看到捆绑ID。在本节中添加捆绑ID

“

编辑
/users // Library/developer/Xcode/deriveddata

删除此文件夹的所有内容,然后从Xcode转到产品,清洁构建文件夹,然后再次构建

“

更改命令行构建的更改使用版本以调试和构建一次。然后切换回释放

Open the workspace file in xcode. Select runner from the side panel and select general tab. You should be able to see the bundle id. Add bundle id in this section

preview

EDIT
/Users//Library/Developer/Xcode/DerivedData

remove all contents of this folder and from Xcode go to product, clean build folder and then build again

Preview

Change use Release for command line builds to debug and build once. Then switch it back to release

十六岁半 2025-02-13 12:58:09

我终于设法通过:

  • 更新Mac OS
  • 卸载并安装最新版本的Xcode

I finally managed to make it work by:

  • updating Mac OS
  • unstalling and installing the latest version of Xcode
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文