xcode 错误 ITMS-90685:“CFBundleIdentifier 冲突。有多个包”

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/40005130/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-15 09:27:01  来源:igfitidea点击:

ERROR ITMS-90685: "CFBundleIdentifier Collision. There is more than one bundle"

iosxcodeapp-store

提问by Raju Abe

When I am try to submit my app to app store, I am getting the error:

当我尝试将我的应用程序提交到应用程序商店时,出现错误:

ERROR ITMS-90685: "CFBundleIdentifier Collision. There is more than one bundle with the CFBundleIdentifier value com.companyname.projectName under the application ProjectName.app"

错误 ITMS-90685:“CFBundleIdentifier 冲突。在应用程序 ProjectName.app 下有多个具有 CFBundleIdentifier 值 com.companyname.projectName 的包”

Can any one help me?

谁能帮我?

回答by Gleb Tarasov

Have you got an App Extension in your app? I had this error because of Cocoapods embedded frameworks inside App Extension folder.

你的应用程序中有应用程序扩展吗?由于 App Extension 文件夹中的 Cocoapods 嵌入式框架,我遇到了这个错误。

You need to remove build phase '[CP] Embed Pods Frameworks'from Extension target.

您需要'[CP] Embed Pods Frameworks'从扩展目标中删除构建阶段。

I wrote such ruby script for that:

我为此编写了这样的 ruby​​ 脚本:

# remove.rb
require 'xcodeproj'

project_path = "Keyboard.xcodeproj"
project = Xcodeproj::Project.open(project_path)
project.targets.each do |target|
    puts target.name
    if target.name.include?("Extension")
        phase = target.shell_script_build_phases.find { |bp| bp.name == '[CP] Embed Pods Frameworks' }
        if !phase.nil?
            puts "Deleting Embed Pods Frameworks phase from #{target.name}…"
            target.build_phases.delete(phase)
        end
    end
end

project.save

In CocoaPods 1.1.0that should be fixed: https://github.com/CocoaPods/CocoaPods/issues/4203

在应该修复的CocoaPods 1.1.0中:https: //github.com/CocoaPods/CocoaPods/issues/4203

回答by Wojtek Dmyszewicz

Steps without script:

没有脚本的步骤:

  • Open the (Your App).xcodeproj file (this is the first file on the project navigator pane).
  • Switch to the target for your app extension (on the top left of the middle pane).
  • Go to the Build Phases tab
  • Click the X after "Embed Pod Frameworks"
  • 打开 (Your App).xcodeproj 文件(这是项目导航器窗格中的第一个文件)。
  • 切换到应用扩展的目标(在中间窗格的左上角)。
  • 转到构建阶段选项卡
  • 单击“嵌入 Pod 框架”后的 X

回答by Victor Sigler

Sometimes this doesn't have anything to do with App Extensions, in an app without any App Extension this can be originated because you're duplicating a framework inside the generated IPA.

有时这与 App Extensions 没有任何关系,在没有任何 App Extensions 的应用程序中,这可能是因为您在生成的 IPA 中复制框架。

In my case the issue was I was importing a framework A that contained other two frameworks B & C, all in the same workspace. In the app I was importing A, B, C but in the framework A the frameworks B & C were embedded with the Embed & signand that's incorrect and it was causing the issue. It should have been added with the Do not embed.

在我的情况下,问题是我正在导入一个包含其他两个框架 B 和 C 的框架 A,它们都在同一个工作区中。在应用程序中,我导入了 A、B、C,但在框架 A 中,框架 B 和 C 嵌入了Embed & 符号,这是不正确的,它导致了问题。它应该与Do not embed一起添加。

I hope this helps you.

我希望这可以帮助你。

回答by Sazzad Hissain Khan

Cause

原因

It happens if your HostApp embeds a framework which has been also embedded in some of the frameworks which are also being embedded in HostApp. For example,

如果您的 HostApp 嵌入了一个框架,该框架也嵌入了一些也嵌入 HostApp 的框架中,则会发生这种情况。例如,

  1. Host Hembeds framework F1and framework F2
  2. Framework F1embeds framework F2
  3. Thus, Framework F2will be duplicated in bundle after IPA generated
  1. 主机H嵌入框架F1和框架F2
  2. 框架F1嵌入框架F2
  3. 因此,框架F2将在 IPA 生成后复制到包中

Solution

解决方案

Only HostApp but no other frameworks should embed any dependent frameworks in their respective Build Phase. So,

只有 HostApp 而不是其他框架应该在它们各自的构建阶段嵌入任何依赖框架。所以,

  1. Go to Build Phase tab for F1
  2. Remove F2from Embed Frameworksstep, or remove full step
  3. Go to General tab for F1
  4. Select Frameworks, Libraries and Embedded Content
  5. Select Do Not Embedoption for F2
  1. 转到构建阶段选项卡 F1
  2. F2Embed Frameworks步骤中删除,或删除完整步骤
  3. 转到常规选项卡 F1
  4. 选择框架、库和嵌入内容
  5. 选择Do Not Embed选项F2

Have a clean build.

有一个干净的构建。

回答by Tim Isenman

If you have an App Extension, make sure it's bundle identifier is distinct from your app's bundle identifier.

如果您有应用扩展,请确保它的捆绑标识符与您应用的捆绑标识符不同。

Example:

例子:

Does not work

不起作用

App Bundle Identifier: company.myApp
Extension Bundle Identifier: company.myApp

应用程序包标识符:company.myApp
扩展包标识符:company.myApp

Works

作品

App Bundle Identifier: company.myApp
Extension Bundle Identifier: company.myApp.extension

应用程序包标识符:company.myApp
扩展包标识符:company.myApp.extension