xcode 无效的捆绑结构 - iOS

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

Invalid Bundle Structure - iOS

iosxcodeitunesapp-store-connect

提问by user2359229

I have tried do submit an application via Xcode (as well as the application loader) to the Apple store, and I received the following error:

我尝试通过 Xcode(以及应用程序加载器)向 Apple 商店提交应用程序,但收到以下错误:

Invalid Bundle Structure - The binary file 'xx.app/xx' is not permitted. Your app may contain only one executable file. Refer to the Bundle Programming Guide for information on the iOS app bundle structure.

无效的捆绑结构 - 不允许使用二进制文件“xx.app/xx”。您的应用程序可能只包含一个可执行文件。有关 iOS 应用程序包结构的信息,请参阅包编程指南。

I checked the files generated files/project settings and I didn't find what's wrong according to the Bundle Programming Guide.

我检查了文件生成的文件/项目设置,但根据 Bundle Programming Guide 没有发现有什么问题。

We have attempted to clean our code repository, as well as do clean builds by updated the build folder locations as well as the derived data locations and still get the same error.

我们试图清理我们的代码存储库,并通过更新构建文件夹位置以及派生数据位置来进行清理构建,但仍然遇到相同的错误。

The only feedback that Apple has given us is a query about whether we use 3rd party libraries, which we do. This has only happened as of a few days ago.

Apple 给我们的唯一反馈是询问我们是否使用了 3rd 方库,我们确实这样做了。这只是几天前发生的。

Any suggestions or step by step instructions to get our binaries uploaded would be greatly appreciated.

任何让我们上传二进制文件的建议或分步说明将不胜感激。

We are using Version 4.6.2 (4H1003) as well as Application Loader 2.8 to upload to iTunes, and we have deployed multiple apps with the exact same structure previously (last app was deployed 2 days prior to the error occuring, and now attempting to reupload the last working binary to an alternate app [after changing relevant app specific info] fails).

我们正在使用版本 4.6.2 (4H1003) 以及 Application Loader 2.8 上传到 iTunes,并且我们之前已经部署了多个具有完全相同结构的应用程序(最后一个应用程序是在错误发生前 2 天部署的,现在尝试将最后一个工作二进制文件重新上传到备用应用程序 [更改相关应用程序特定信息后] 失败)。

Thanks in advance.

提前致谢。

回答by user1709076

For me the answer was to

对我来说,答案是

  1. go to

    /Users/myusername/Library/Developer/Xcode/Archives

  2. go to the current folder for the latest archive.

  3. right-click the .xarchive and select 'show package contents'

  4. navigate inside the 'products/applications' directory

  5. right-click the myAppName.app and select 'show package contents'

  6. delete the exe at the very bottom that was not named myAppName.exe

  1. /Users/myusername/Library/Developer/Xcode/Archives

  2. 转到最新存档的当前文件夹。

  3. 右键单击 .xarchive 并选择“显示包内容”

  4. 在“产品/应用程序”目录中导航

  5. 右键单击 myAppName.app 并选择“显示包内容”

  6. 删除最底部未命名为 myAppName.exe 的 exe

回答by pkamb

Some developers have hit this issue when integrating the Apptentive iOS SDK. Making the same error with other 3rd-party SDKS will cause the same issue.

一些开发人员在集成Apptentive iOS SDK时遇到了这个问题。使用其他 3rd-party SDKS 犯同样的错误会导致同样的问题。

Invalid Build Structure

Invalid Build Structure

The binary file 'YourApp.app/libApptentiveConnect.a' is not permitted.

The binary file 'YourApp.app/libApptentiveConnect.a' is not permitted.

Your app may contain only one executable file."

Your app may contain only one executable file."

This error occurs when the Apptentive static library is copied to the app bundle.

将 Apptentive 静态库复制到应用程序包时会发生此错误。

libApptentiveConnect.ashould be added to the target's Link Binary with Librariesbuild phase.

libApptentiveConnect.a应添加到目标的链接二进制文件与库构建阶段。

It should notbe added to the target's Copy Bundle Resourcesbuild phase.

它应该被添加到目标的复制包资源构建阶段。

回答by Christine

I know this is a rather old post, but I ran into this issue and this is how I fixed it:

我知道这是一个相当老的帖子,但我遇到了这个问题,这是我修复它的方法:

  1. In Xcode, click on your project and go to the target's build settings.
  2. Make sure the "Build Variants" setting ONLY has "normal" set for the target.
  3. Clean and rebuild.
  1. 在 Xcode 中,单击您的项目并转到目标的构建设置。
  2. 确保“构建变体”设置仅为目标设置了“正常”。
  3. 清洁和重建。

I believe this is what fixed the problem, but there is one other change that may have had an effect.

我相信这就是解决问题的方法,但还有一个可能产生了影响的其他变化。

At one point, I had turned off 'Parallelize Build" in my active Scheme. I had since turned it back on, but perhaps it left some artifacts. I doubt this had any connection, but just in case, I went to my build folders and deleted the files inside before I cleaned and built.

有一次,我在活动的 Scheme 中关闭了“Parallelize Build”。从那以后我又重新打开了它,但也许它留下了一些工件。我怀疑这有什么联系,但为了以防万一,我去了我的构建文件夹并在我清理和构建之前删除了里面的文件。

I hope this can help someone who runs into this issue.

我希望这可以帮助遇到这个问题的人。

回答by Lyck

I had put my NSBundle.m in Copy bundle resources - don't do that :(

我已经把我的 NSBundle.m 放在复制包资源中 - 不要这样做:(

回答by hokkuk

see screen shot, this is the right side of xcode, where it says "text Encoding", 4 of my header files and objective C files where called something like "regular text files" instead of "Unicode (UTF-8), how they got that way, I don't know, but xCode decided to make them into binaries ".o" files, and even put them in where the pngs go in an archived project.

看屏幕截图,这是 xcode 的右侧,上面写着“文本编码”,我的 4 个头文件和目标 C 文件被称为“常规文本文件”而不是“Unicode (UTF-8)”,它们是如何是这样的,我不知道,但 xCode 决定将它们制作成二进制“.o”文件,甚至将它们放在存档项目中 png 所在的位置。

enter image description here

在此处输入图片说明

回答by ToddB

I ran into this as well. In my case a symlink to a binary (Xcode) had been added to the project (somehow). Removing from the project was the fix.

我也遇到了这个。在我的例子中,一个二进制文件 (Xcode) 的符号链接已被添加到项目中(不知何故)。从项目中删除是修复。

回答by Maron Kristofersson

I had this problem, tried all of the solutions above and didn't work for me. In the end it was solved by creating the app in iTunesConnect ( itunesconnnect.apple.com ).

我遇到了这个问题,尝试了上述所有解决方案,但对我不起作用。最后通过在 iTunesConnect (itunesconnnect.apple.com) 中创建应用程序解决了这个问题。