升级Xcode12和macOS BigSur后使用框架时,iOS/macOS应用分发失败 [英] iOS/macOS app distribution failed while using framework after upgrading Xcode12 and macOS BigSur

查看:183
本文介绍了升级Xcode12和macOS BigSur后使用框架时,iOS/macOS应用分发失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们无法分发使用我们框架的示例应用程序,而用户也无法分发.在存档和分发到AppStore时,该应用将被拒绝,并显示以下消息:

We are unable to distribute our sample app which uses our framework as well as our users can't. While archiving and distributing to AppStore, the app is rejected with the following message:

无效的捆绑包-dylib搜索路径中不存在您的应用程序引用的一个或多个动态库.如果您的应用包含位码,则位码处理可能失败.由于存在这些错误,因此无法将该应用程序的内部版本提交审核或放置在App Store中.

框架包含位代码,或者在我们的 .xcconfig 中至少存在一个 BITCODE_GENERATION_MODE = bitcode 构建设置,这基本上意味着Xcode将添加-fembed-bitcode 生成任何clang调用的标志.

The framework contain the bitcode, or at least there's a BITCODE_GENERATION_MODE = bitcode build setting in our .xcconfig, which basically means, the Xcode will add -fembed-bitcode build flag to any clang invocation.

从这里,我们已经开始使用 ad-hoc 构建进行测试,加快我们的试用和错误尝试,而在重建从BitCode 选项时也会失败,这也失败了.组织者将显示包含以下内容的弹出窗口:

From here, we've started testing using Ad-Hoc builds, to speed up our trial and error attempts, which also fails while Rebuild from bitcode option is selected. Organiser shows the popup with the following contents:

ipatool failed with an exception: #<CmdSpec::NonZeroExitException: $ /Applications/Xcode.app/Contents/Developer/usr/bin/python3 /Applications/Xcode.app/Contents/Developer/usr/bin/bitcode-build-tool -v -t /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin --sdk /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS14.2.sdk -o /var/folders/vz/b0jj0dms4014y5htfv93svfc0000gn/T/ipatool20201130-52097-13rj9hy/thinned-out/arm64/Payload/iosTest.app/Frameworks/SciChart.framework/SciChart --generate-dsym /var/folders/vz/b0jj0dms4014y5htfv93svfc0000gn/T/ipatool20201130-52097-13rj9hy/thinned-out/arm64/Payload/iosTest.app/Frameworks/SciChart.framework/SciChart.dSYM --strip-swift-symbols /var/folders/vz/b0jj0dms4014y5htfv93svfc0000gn/T/ipatool20201130-52097-13rj9hy/thinned-in/arm64/Payload/iosTest.app/Frameworks/SciChart.framework/SciChart
Status: pid 52150 exit 1
Stdout:
    SDK path: /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/

提供的日志信息不是很丰富,这是 IDEDistributionPipeline.log

Logs provided isn't very informative, here is the snippet from IDEDistributionPipeline.log

    -= Output =-
    ld: warning: -sdk_version and -platform_version are not compatible, ignoring -sdk_version
    Undefined symbols for architecture arm64:
      "___llvm_profile_runtime", referenced from:
          __hidden#25821_ in 0832.o
          __hidden#25821_ in 0833.o
          __hidden#25821_ in 0834.o
          __hidden#25821_ in 0835.o
          __hid
2020-11-30 16:19:17 +0000  den#25821_ in 0836.o
          __hidden#25821_ in 0837.o
          __hidden#25821_ in 0838.o
          ...
    ld: symbol(s) not found for architecture arm64
    Exited with 1z
    
    Failed to compile bundle: /var/folders/vz/b0jj0dms4014y5htfv93svfc0000gn/T/SciChart6aun_sfs/SciChart.arm64.xar

Stderr:

    from /Applications/Xcode.app/Contents/Developer/usr/bin/ipatool:2808:in `block in CompileOrStripBitcodeInBundle'
    from /Applications/Xcode.app/Contents/Developer/usr/bin/ipatool:2747:in `each'
    from /Applications/Xcode.app/Contents/Developer/usr/bin/ipatool:2747:in `CompileOrStripBitcodeInBundle'
    from /Applications/Xcode.app/Contents/Developer/usr/bin/ipatool:3016:in `block in ProcessIPA'
    from /Applications/Xcode.app/Contents/Developer/usr/bin/ipatool:2978:in `each'
    from /Applications/Xcode.app/Contents/Developer/usr/bin/ipatool:2978:in `ProcessIPA'
    from /Applications/Xcode.app/Contents/Developer/usr/bin/ipatool:3928:in `<main>'
2020-11-30 16:19:17 +0000  /Applications/Xcode.app/Contents/Developer/usr/bin/ipatool exited with 1

在出现一堆警告后,它在文件末尾显示了实际错误(我不能包括完整的日志,因为它太多了原始文本):

which after bunch of warnings shows the actual error at the end of file (I can't include full log, since it's too much of a raw text):

            code = 1061;
            description = "ipatool failed with an exception: #<CmdSpec::NonZeroExitException: ...
            info =             {
            };
            level = ERROR;
            type = exception;

不确定该怎么做,我尝试了不同的构建设置选项,没有任何帮助...已经联系了Apple,但是还没有反馈,知道了它们,我们可以等待太久......

Not sure what to to do with this, I've tried different build settings options, nothing helped... Already contacted apple, but no feedback yet, and knowing them, we can wait far too long...

这里的奇怪之处在于,如果我们直接将.framework包含为源代码,然后将其存档,则一切都会按预期进行.如果我们将其作为 XCFramework 或只是.framework(已预先构建)包含,则它会如上所述失败.

The strange part here, is if we include our .framework directly as a source code and then archive the app - everything works as expected. If we include it as XCFramework or just .framework, which is pre-built - it fails as described above.

在这里我可能会错过一些简单或显而易见的事情,所以请让我知道是否有人对此事有见识.

I might miss something simple or obvious here, so please let me know if somebody have some insights on that matter.

Some system info:
macOS BigSur 11.0.1
XCode Version 12.2 (12B45b)

我们尝试了macOS和Xcode的不同组合,例如:

We've tried different combinations of macOS and Xcode, e.g.:

Catalina with Xcode 12
BigSur with Xcode 11
etc.

任何帮助将不胜感激.谢谢.

Any help is greatly appreciated. Thanks.

推荐答案

长话短说,其中包含LLVM工具,阻止了AppStore处理.我在这里写了一个完整的博客文章- https://blog.scichart.com/xcframework-xcode-12-and-bigsur-issues/

Long story short, there were LLVM instrumentation included, which prevents AppStore processing. I've written a whole blog post about it here - https://blog.scichart.com/xcframework-xcode-12-and-bigsur-issues/

总而言之,这是确保创建用于分发的 XCFramework 时需要执行的一些步骤:

To sum up, here is a few required steps to make sure while creating XCFramework for distribution:

  • 使用存档版本是必须,发布版本还不够
  • BUILD_LIBRARY_FOR_DISTRIBUTION 必须设置为 YES
  • SKIP_INSTALL 必须设置为 NO
  • GCC_INSTRUMENT_PROGRAM_FLOW_ARCS = NO 关闭GCC检测并将其从二进制文件中删除
  • CLANG_ENABLE_CODE_COVERAGE = NO 从二进制文件中关闭代码覆盖工具
  • Using archive builds is a MUST, release build isn't enough
  • BUILD_LIBRARY_FOR_DISTRIBUTION must be set to YES
  • SKIP_INSTALL must be set to NO
  • GCC_INSTRUMENT_PROGRAM_FLOW_ARCS = NO to turn off GCC instrumentation and remove them from the binary
  • CLANG_ENABLE_CODE_COVERAGE = NO to turn off code coverage tools from the binary

具备上述所有条件有助于解决我们的准备和分发问题,并希望在您碰巧遇到与我们相同的问题时为您节省一些时间.

Having all of the above helped to solve our preparing and distribution problem and hopefully save you some time if you happened to face same issues as we did.

这篇关于升级Xcode12和macOS BigSur后使用框架时,iOS/macOS应用分发失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆