“无法检查应用程序包”Xcode
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/14630828/
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
“could not inspect application package” Xcode
提问by user2014474
For some reason I imported some files in xcode (a third party SDK), and even if the app builds successfully I receive this error: Xcode Error Message: “could not inspect application package”. What does it mean? the app doesn't run on a real device but works on a simulator IOS...
出于某种原因,我在 xcode(第三方 SDK)中导入了一些文件,即使应用程序构建成功,我也会收到此错误:Xcode 错误消息:“无法检查应用程序包”。这是什么意思?该应用程序不能在真实设备上运行,但可以在模拟器 IOS 上运行...
采纳答案by Aaron Brager
It sounds like the third party files might include compiled code which is not signed by you. If so, you can use iReSignto resign them using your own certificate. You can also use the command line:
听起来第三方文件可能包含未经您签名的编译代码。如果是这样,您可以使用iReSign使用您自己的证书对它们进行签名。您也可以使用命令行:
codesign -f -s "iPhone Developer: Aaron Brager (XXXXXXXXXX)" nameOfAppToSign.app
Replace the example identity with your own (you can man codesign
to read more about this command).
用您自己的身份替换示例身份(您可以man codesign
阅读有关此命令的更多信息)。
You can circumvent this by not including the compiled code. It may not be necessary - are you including an example app which isn't necessary for the framework to function?
您可以通过不包含已编译的代码来规避这一点。可能没有必要 - 您是否包含框架运行不需要的示例应用程序?
If this answer doesn't help, providing the name of the framework and showing which files you included would be helpful.
如果这个答案没有帮助,提供框架的名称并显示您包含的文件会有所帮助。
回答by ArunJTS
When I replaced the 'Resources' folder on the xcode, by mistake the below option was selected.
当我替换 xcode 上的“Resources”文件夹时,错误地选择了以下选项。
Create folder references for any added folders
But the correct option should be,
但正确的选择应该是,
Create groups for any added folders
Taking care of the above option is important point in saving time ad fixing the above issue. (It is one of the possibilities for getting this error).
照顾好上述选项对于节省时间和解决上述问题很重要。(这是获得此错误的可能性之一)。
回答by UdayM
回答by KMC
I was getting the same error. I resolve it by removing third party library from "embbedded binaries" list and added into the "linked frameworks and libraries".
我遇到了同样的错误。我通过从“嵌入式二进制文件”列表中删除第三方库并添加到“链接框架和库”中来解决它。
回答by matiasjaure
I solved this just doing a Product->Clean after doing a lot of stupid stuff
在做了很多愚蠢的事情之后,我只是做了一个 Product->Clean 解决了这个问题
回答by huggie
In my case I was working with Cordova and Firebase. Remove all Google frameworks from Embed frameworks
(but leave them under Linked Binary With Libraries
) solve the problem.
就我而言,我正在使用 Cordova 和 Firebase。从 中删除所有 Google 框架Embed frameworks
(但将它们保留在 下Linked Binary With Libraries
)解决问题。
回答by Whitney Foster
I was importing a framework in my bridging header that I previously removed and Xcode gave me no error I guess because I didn't call the framework anymore?
我在我之前删除的桥接头中导入了一个框架,Xcode 没有给我任何错误,我猜是因为我不再调用该框架了?
Steps:
脚步:
- remove the unused/nonexistent framework for bridging header
- cmd+shift+k
- quit Xcode
- find your project's build folder and trash the contents of the Intermediates and Products folders
- open your project and run
- 删除未使用/不存在的桥接头框架
- cmd+shift+k
- 退出 Xcode
- 找到您项目的构建文件夹并清除中间件和产品文件夹的内容
- 打开你的项目并运行
This may be overkill but it works now. I hope this helps.
这可能有点矫枉过正,但它现在有效。我希望这有帮助。
回答by Eonil
Check whether you are embedding a static library into app package. Some third party packages their static library SDK like a dynamic framework. Which is unsupported by Xcode (yet?). In that case you can be fooled and put them in "Embedded Binaries" list. Static libraries SHOULD NOT be in the list.
检查您是否将静态库嵌入到应用程序包中。一些第三方将他们的静态库 SDK 打包成一个动态框架。Xcode 不支持哪个(还有?)。在这种情况下,您可能会被愚弄并将它们放在“嵌入式二进制文件”列表中。静态库不应该在列表中。
To check whether it is a static library, use file
utility.
要检查它是否是静态库,请使用file
实用程序。
file /path/to/binary/in/Example1.framework/Example1
If it says something like ar archive
it's a static library, and dynamically linked shared library
for dynamic library.
如果它说它是ar archive
静态库,并且dynamically linked shared library
是动态库。
回答by Hyman Bellis
I got the same error. It was after I added a new, empty text file to my project (to keep some notes in) and named it Resources. Renaming it to Resourcesx fixed the problem but not until doing a Clean. I proved repeatedly that the filename "Resources" is a sufficient condition to cause the error.
我得到了同样的错误。这是在我向我的项目添加一个新的空文本文件(以保留一些笔记)并将其命名为 Resources 之后。将其重命名为 Resourcesx 解决了问题,但直到执行 Clean 后才能解决。我反复证明文件名“Resources”是导致错误的充分条件。
This is the same experience of someone in Xcode Error Message: "could not inspect application package"
这与有人在Xcode 错误消息中的经历相同 :“无法检查应用程序包”