xcode 框架在其 Info.plist 中没有 CFBundleIdentifier

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/37601925/
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 08:51:24  来源:igfitidea点击:

Framework did not have a CFBundleIdentifier in its Info.plist

iosxcodeswiftcocoapods

提问by Rorschach

I was having issues with my Bridge.h imports finding their intended targets after a cocoapods install and run.

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

I had:

我有:

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

But it didnt work because my Headers folder was empty, so I copied those two folder into the Headers folder and hardcoded the path:

但它不起作用,因为我的 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>

This worked and the app built but when I ran it it gave this error: The operation couldn't be completed. (LaunchServicesError error 0.)

这有效并且应用程序构建但是当我运行它时它给出了这个错误: The operation couldn't be completed. (LaunchServicesError error 0.)

Here is the console output:

这是控制台输出:

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}

The initiall error that I have looks alot like this stuff: Unable to run app in Simulator: An error was encountered while running (Domain = LaunchServicesError, Code = 0)I tried all the clean builds and the reboots suggested but none worked. Also all the sharekit solutions also did not work because I do not have sharekit.

我的初始错误看起来很像这样的东西:无法在模拟器中运行应用程序:运行时遇到错误(域 = LaunchServicesError,代码 = 0)我尝试了所有干净的构建并建议重新启动,但没有奏效。此外,所有 sharekit 解决方案也不起作用,因为我没有 sharekit。

EDIT 1

编辑 1

My guess is this: Frameworks/TPKeyboardAvoiding.framework did not have a CFBundleIdentifier in its Info.plist}is the real problem and I need to change my info.plist file to find TPKeyboardAvoiding

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

EDIT 2

编辑 2

My info.plist:

我的信息.plist:

enter image description here

在此处输入图片说明

EDIT 3

编辑 3

This question is a problem that arose after I tried to workaround the problem which I ran into before which is described in this question: Empty Pod Headers Folder after `pod install`

这个问题是在我尝试解决之前遇到的问题之后出现的问题,这个问题在这个问题中描述过:“pod install”之后的空 Pod 头文件夹

回答by Ruud Visser

For me cleaning the build folder worked. In Xcode, hold altProduct -> Clean Build Folder..

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

Let me know if it works for you!

请让我知道这对你有没有用!

回答by hfossli

I had to close xcode and delete derived data. Just delete this folder

我不得不关闭 xcode 并删除派生数据。直接删除这个文件夹

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


None of these approaches worked for me

这些方法都不适合我

  1. gem uninstall cocoapods, gem install cocoapodsand pod install
  2. pod install
  3. clean xcode using cmd+k
  1. gem uninstall cocoapodsgem install cocoapodspod install
  2. pod install
  3. 使用干净的 xcode cmd+k

回答by MANISH PATHAK

This is the strange behaviour of Xcode.

这是 Xcode 的奇怪行为。

FIXED SOLUTION:

固定解决方案:

0- Simulator: Simulator> Reset Content & Settings

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

1- Hold altProduct-> CleanBuild Folder

1-保持altProduct->Clean构建文件夹

2- Close Xcode

2-关闭Xcode

3- Go to project directory using terminal cd ~/projectDir

3-使用终端转到项目目录 cd ~/projectDir

4- Run pod install

4-运行 pod install

5- Open project in Xcode

5- 在 Xcode 中打开项目

6- Run the project.

6- 运行项目。

回答by Rorschach

$ gem uninstall cocoapods
$ gem install cocoapods

Add all things (crashlytics and fabric included) as pods. Delete any extra things you made i.e. /Users/username/Documents/new_ios/ios-app/Pods/Headers/TPKeyboardAvoiding/TPKeyboardAvoidingScrollView.h

将所有东西(包括crashlytics 和fabric)添加为pod。删除您制作的任何额外内容,即 /Users/username/Documents/new_ios/ios-app/Pods/Headers/TPKeyboardAvoiding/TPKeyboardAvoidingScrollView.h

$ pod install

回答by ARSHWIN DENUEV LAL

we have two options to resolve the issue

我们有两种选择来解决这个问题

  1. Delete the derived data from xcode's default location as specified in File -> Workspace Settings

  2. Change the derived data location to a custom location in File -> Workspace Settings

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

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