【问题标题】:Framework did not have a CFBundleIdentifier in its Info.plist框架在其 Info.plist 中没有 CFBundleIdentifier
【发布时间】:2016-06-02 20:53:20
【问题描述】:

在安装并运行 cocoapods 后,我的 Bridge.h 导入找到其预期目标时遇到问题。

我有:

#import <TPKeyboardAvoiding/TPKeyboardAvoidingScrollView.h>
#import <DateTools/DateTools.h>

但它不起作用,因为我的 Headers 文件夹是空的,所以我将这两个文件夹复制到 Headers 文件夹中并硬编码路径:

#import </Users/username/Documents/new_ios/ios-app/Pods/Headers/TPKeyboardAvoiding/TPKeyboardAvoidingScrollView.h>
#import </Users/username/Documents/new_ios/ios-app/Pods/Headers/DateTools/DateTools.h>

这有效并且应用程序已构建,但当我运行它时出现此错误:The operation couldn’t be completed. (LaunchServicesError error 0.)

这是控制台输出:

6/2/16 4:41:24.961 PM uploadDSYM[3519]: Fabric.framework/run 1.4.0
6/2/16 4:41:24.981 PM uploadDSYM[3521]: Fabric.framework/run 1.4.0
6/2/16 4:41:25.011 PM appleeventsd[51]: SecTaskLoadEntitlements failed error=22
6/2/16 4:41:25.019 PM sharedfilelistd[251]: SecTaskLoadEntitlements failed error=22
6/2/16 4:41:25.093 PM Fabric[257]: Bundle indentifier is of type (null), returning empty string.
6/2/16 4:41:25.752 PM com.apple.CoreSimulator.CoreSimulatorService[331]: Error Domain=LaunchServicesError Code=0 "(null)" UserInfo={Error=MissingBundleIdentifier, ErrorDescription=Bundle at path /Users/username/Library/Developer/CoreSimulator/Devices/#####-####-####-####-##########/data/Library/Caches/com.apple.mobile.installd.staging/temp.16rUWf/extracted/AppName.app/Frameworks/TPKeyboardAvoiding.framework did not have a CFBundleIdentifier in its Info.plist}

我遇到的初始错误看起来很像这样的东西:Unable to run app in Simulator: An error was encountered while running (Domain = LaunchServicesError, Code = 0) 我尝试了所有干净的构建并建议重新启动,但没有一个起作用。由于我没有 sharekit,所以所有的 sharekit 解决方案也都不起作用。

编辑 1

我的猜测是:Frameworks/TPKeyboardAvoiding.framework did not have a CFBundleIdentifier in its Info.plist} 是真正的问题,我需要更改我的 info.plist 文件以找到 TPKeyboardAvoiding

编辑 2

我的 info.plist:

编辑 3

这个问题是在我尝试解决之前遇到的问题后出现的问题,该问题在此问题中有所描述:Empty Pod Headers Folder after `pod install`

【问题讨论】:

标签: ios xcode swift cocoapods


【解决方案1】:

对我来说清理构建文件夹有效。在 Xcode 中,按住 alt Product -> Clean Build Folder..

让我知道它是否适合你!

【讨论】:

  • 为我工作!想知道清理构建文件夹和清理项目之间的主要区别是什么......谷歌可能知道。
  • 感谢您的回答,这对我来说是解决方案。我想邀请您正如@justColbs 提到的那样描述默认清理和清理构建文件夹之间的区别。
  • @justColbs here 是我们正在寻找的 :)
  • 为我工作了 4 个!非常感谢。
【解决方案2】:

我不得不关闭 xcode 并删除派生数据。只需删除此文件夹

rm -rf ~/Library/Developer/Xcode/DerivedData/

这些方法都不适合我

  1. gem uninstall cocoapodsgem install cocoapodspod install
  2. pod install
  3. 使用cmd+k 清理xcode

【讨论】:

    【解决方案3】:

    这是 Xcode 的奇怪行为。

    固定解决方案:

    0- 模拟器:Simulator > Reset Content &amp; Settings

    1- 保留alt Product -> Clean 构建文件夹

    2- 关闭 Xcode

    3- 使用终端进入项目目录 cd ~/projectDir

    4- 运行pod install

    5- 在 Xcode 中打开项目

    6- 运行项目。

    【讨论】:

      【解决方案4】:
      $ gem uninstall cocoapods
      $ gem install cocoapods
      

      将所有东西(包括崩溃分析和织物)添加为 pod。 删除您所做的任何额外内容,即 /Users/username/Documents/new_ios/ios-app/Pods/Headers/TPKeyboardAvoiding/TPKeyboardAvoidingScrollView.h

      $ pod install
      

      【讨论】:

      • 这对任何人有用吗?刚试了一下,还是不行。
      【解决方案5】:

      我们有两种方法来解决这个问题

      1. 从文件 -> 工作区设置中指定的 xcode 默认位置删除派生数据

      2. 在文件 -> 工作区设置中将派生数据位置更改为自定义位置

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2016-05-25
        • 1970-01-01
        • 2015-05-21
        • 2021-03-12
        • 2019-07-20
        • 2015-12-30
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多