Xcode 9,迦太基。 iTunes Connect错误:"无效的捆绑包 - 不允许的LLVM工具"

时间:2017-09-11 16:40:26

标签: ios xcode itunesconnect carthage xcode9

今天我下载了Xcode 9并对我的应用程序进行了必要的更改以进行编译。该应用程序正在本地编译和运行,没有任何问题。

使用Xcode 9我将其上传到App Store。上传成功,没有任何错误。

然后我从Apple发来以下电子邮件:

  

亲爱的开发人员,

     

我们发现您最近交付的一个或多个问题   " KiteSpotter - 风筝冲浪风和天气预报"。处理你的   交货时,必须纠正以下问题:

     

无效的捆绑包 - 不允许使用LLVM工具。不要提交应用   启用LLVM分析工具或coverage集合。   关闭LLVM分析或代码覆盖率,重建您的应用程序和   重新提交应用程序。

     

一旦这些问题得到纠正,您就可以重新发送   纠正二进制。

     

此致

     

App Store团队

我去了我的目标和可可豆荚目标的代码覆盖率,这是我能找到的唯一相关设置:

enter image description here

重新提交申请,我收到同样的错误。

在我的项目中,我使用的是Carthage,它有超过15个依赖项。在寻找解决方案时,我发现所有项目都需要使用上述设置进行更新。

  • 是否有任何解决方案可以自动为所有框架设置此设置,如果这导致了问题。
  • 是否有其他人遇到过此问题并将其整理出来。迦太基框架是否会产生问题?

4 个答案:

答案 0 :(得分:34)

自动将所有依赖项的代码覆盖率设置为false的解决方案是在终端上运行以下命令(请转到项目目录):

grep -lR "codeCoverageEnabled" --include *.xcscheme --null Carthage | xargs -0 sed -i '' -e 's/codeCoverageEnabled = "YES"/codeCoverageEnabled = "NO"/g'

这会将代码覆盖率设置为NO,iTunes连接不会抱怨。

使一切正常的顺序如下

  • 运行carthage update --platform iOS --no-use-binaries --no-build。这将更新和下载所有dependecies。 当Carthage开始编译时,你可以按ctrl + c取消。
  • 运行以上命令将代码覆盖率设置为NO
  • 现在一切都在运行carthage build --platform iOS。这将构建代码覆盖率为NO的所有内容

您现在可以存档并上传到iTC。

命令由https://github.com/gunterhager给出,所以归功于他

作为 fastlane用户的替代方案,请将以下内容添加到fastlane文件中,该文件将自动执行所有操作:

  desc "Update Carthage"
  lane :update_carthage do
    carthage(
      command: "update",       # One of: build, bootstrap, update, archive. (default: bootstrap)
      use_binaries: false,         # Check out dependency repositories even when prebuilt frameworks exist
      no_build: true,  # When bootstrapping Carthage do not build
      platform: "iOS"  # Define which platform to build for (one of ‘all’, ‘Mac’, ‘iOS’, ‘watchOS’, ‘tvOS‘, or comma-separated values of the formers except for ‘all’)
    )
    sh("grep -lR 'codeCoverageEnabled' --include *.xcscheme --null Carthage | xargs -0 sed -i '' -e 's/codeCoverageEnabled = 'YES'/codeCoverageEnabled = 'NO'/g'")
    carthage(
      command: "build",       # One of: build, bootstrap, update, archive. (default: bootstrap)
      platform: "iOS"  # Define which platform to build for (one of ‘all’, ‘Mac’, ‘iOS’, ‘watchOS’, ‘tvOS‘, or comma-separated values of the formers except for ‘all’)
    )
  end

答案 1 :(得分:13)

快速修复,在终端中运行这些命令(确保转到项目的根文件夹):

  • carthage update --platform iOS --no-use-binaries --no-build这会更新您的依赖项,但不会构建任何内容。

  • grep -lR "codeCoverageEnabled" --include *.xcscheme --null Carthage | xargs -0 sed -i '' -e 's/codeCoverageEnabled = "YES"/codeCoverageEnabled = "NO"/g'这会将代码覆盖率设置为NO

  • carthage build --platform iOS这将最终构建所有没有代码覆盖的框架。

现在您可以存档项目并将其上传到iTunes Connect。

Carthage项目中的好人已经在开发更加用户友好的解决方案了,所以一定要检查那里的版本。

答案 2 :(得分:2)

只需将#include <stdio.h> #include <stdlib.h> #include <ctype.h> #include <string.h> #define NUMARG 3 #define INFILEARG 1 #define OUTFILEARG 2 int countWords(const char *sentence); int main(int argc, char *argv[]){ /* File pointers */ FILE *finp; FILE *foutp; /* Three levels of strings: word < line < text. Both token variables to use with strtok splitting the text. */ char **holdWords = NULL, *holdLine = NULL, *holdText = NULL, *lineToken = NULL, *wordToken = NULL; int stringSize = 0, totalStrings, i; size_t size = 0; /* Add .txt extension */ int inFileNameSize = sizeof(argv[INFILEARG]); int outFileNameSize = sizeof(argv[OUTFILEARG]); char inFileName[inFileNameSize+4]; //add 4 to have room for ".txt" char outFileName[outFileNameSize+4]; strcat(inFileName, argv[INFILEARG]); strcat(inFileName, ".txt"); strcat(outFileName, argv[OUTFILEARG]); strcat(outFileName, ".txt"); /* Check for errors in argument number and opening files. */ if(argc != NUMARG){ printf("You have to put the input and output files after the program name.\n"); fflush(stdout); return(1); } if( (finp = fopen(inFileName, "r")) == NULL ){ printf("Couldn't open %s for reading.\n", inFileName); fflush(stdout); return(1); } if( (foutp = fopen(outFileName, "w")) == NULL){ printf("Couldn't open %s for writing.\n", outFileName); fflush(stdout); return(1); } 更新为版本Carthage或更高版本,然后再次运行0.26.0命令。

答案 3 :(得分:2)

我也从Xcode 9.1得到同样的错误,即使我已经将Carthage更新到最新版本https://github.com/Carthage/Carthage/releases我没能将内容上传到iTunes

enter image description here

以这种方式为我工作: -

如果您已将 Xcode更新为9.1 ,那么

https://github.com/Carthage/Carthage/releases

更新carthage.pkg次下载

安装.pkg

通过参考您的项目在carthage update中提供Terminal命令

然后转到您的项目Build Settings,找到Enable Code Coverage Support将该设置从 Yes 更改为 No

enter image description here

然后存档并上传到AppStore。您的构建将是readyHappy

enter image description here