【问题标题】:BundleID problems between Xcode/flutterXcode/flutter 之间的 BundleID 问题
【发布时间】:2020-12-04 18:38:30
【问题描述】:

TLDR;我创建了一个 swift 小部件,但现在我无法构建我的颤振应用程序。


我按照本教程创建了一个小部件

https://itnext.io/develop-an-ios-14-widget-in-flutter-with-swiftui-e98eaff2c606

一切顺利,我在 Xcode 中构建,瞧,我有了一个小部件和我的应用程序。 回vscode修改,现在无法build,出现bundle冲突!

Unable to install /Users/monsters/Projects/flutter_time_to_call/my_app/build/ios/iphonesimulator/Runner.app on 45CE9F59-2AC0-494F-B043-C3F1B4E27EFC. This is
sometimes caused by a malformed plist file:
ProcessException: Process exited abnormally:
An error was encountered processing the command (domain=IXErrorDomain, code=2):
Failed to set plugin placeholders for com.bigmojo.timeToCall
Failed to create promise.
Underlying error (domain=IXErrorDomain, code=8):
        Attempted to set plugin placeholder promise with bundle ID com.example.timeToCall.time-to-call-widget that does not match required prefix of
        com.bigmojo.timeToCall. for parent
        Mismatched bundle IDs.

我已经手动创建了配置文件等...并在 Xcode 中使用了具有“正确”捆绑 ID 的它们,但有些东西一直忽略它们,并生成该 com.example 捆绑 ID... 不知道从这里去哪里!

有人指出,可能我的 info.plist 没有更新,但我检查了,这是相关部分

<key>CFBundleDisplayName</key>
<string>time_to_call_widget</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>

我更改了显示名称,但没有任何作用..

Attempted to set plugin placeholder promise with bundle ID com.example.timeToCall.time-to-call-widget

我在整个项目中搜索了 example 这个词,也没有找到任何东西..

我已经看到 cmets 关于它是 Xcode 中的 bundleid 设置,但我已经做了所有我能想到的......

【问题讨论】:

    标签: ios xcode flutter


    【解决方案1】:

    答案是运行

    flutter clean
    

    谢谢!斯特凡诺

    【讨论】:

      【解决方案2】:

      默认情况下,Info.plist 文件指向 PRODUCT_BUNDLE_IDENTIFIER 变量的 CFBundleIdentifier 键。

      PRODUCT_BUNDLE_IDENTIFIER 变量在文件中定义:

      project/ios/Runner.xcodeproj/project.pbxproj

      确保通过将PRODUCT_BUNDLE_IDENTIFIER 设置为您需要的值来编辑上面的文件。请注意,应该有 3 次出现,请务必编辑所有这些:

      PRODUCT_BUNDLE_IDENTIFIER = com.newpackage.app;

      更新:

      我检查了 project/ios/Runner.xcodeproj/project.pbxproj 文件,PRODUCT_BUNDLE_IDENTIFIER 的所有设置“似乎”正确

      EG:

      PRODUCT_BUNDLE_IDENTIFIER = com.bigmojo.timeToCall.widget;
      PRODUCT_NAME = "$(TARGET_NAME)";
      PROVISIONING_PROFILE_SPECIFIER = "time to call widget";
      

      【讨论】:

      • 感谢您的建议,我检查了文件,一切似乎都很好,或者至少不包含 com.example...抱歉格式化...MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; MTL_FAST_MATH = 是; PRODUCT_BUNDLE_IDENTIFIER = com.bigmojo.timeToCall.widget; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = "调用小部件的时间"; SKIP_INSTALL = 是; SWIFT_ACTIVE_COMPILATION_CONDITIONS = 调试; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2";
      • 您尝试运行flutter clean 吗?
      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-09-07
      • 1970-01-01
      • 2023-04-08
      • 2020-05-14
      • 2011-10-19
      • 2017-01-29
      相关资源
      最近更新 更多