简体   繁体   English

升级 Xcode12 和 macOS BigSur 后使用框架时 iOS/macOS 应用程序分发失败

[英]iOS/macOS app distribution failed while using framework after upgrading Xcode12 and macOS BigSur

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:在归档和分发到 AppStore 时,应用程序被拒绝并显示以下消息:

Invalid Bundle - One or more dynamic libraries that are referenced by your app are not present in the dylib search path. If your app contains bitcode, bitcode processing may have failed. Because of these errors, this build of your app will not be able to be submitted for review or placed on the App Store.

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.该框架包含位码,或者至少在我们的.xcconfig中有一个BITCODE_GENERATION_MODE = bitcode构建设置,这基本上意味着 Xcode 将在任何 clang 调用中添加-fembed-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.从这里开始,我们开始使用Ad-Hoc构建进行测试,以加快我们的试错尝试,但在选择Rebuild from bitcode选项时也会失败。 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/

Logs provided isn't very informative, here is the snippet from IDEDistributionPipeline.log提供的日志信息量不大,这里是来自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;

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...不知道该怎么办,我尝试了不同的构建设置选项,没有任何帮助......已经联系了苹果,但还没有反馈,知道他们,我们可以等待太久......

The strange part here, is if we include our.framework directly as a source code and then archive the app - everything works as expected.这里奇怪的部分是,如果我们直接将 our.framework 作为源代码包含在内,然后归档应用程序 - 一切都按预期工作。 If we include it as XCFramework or just.framework, which is pre-built - it fails as described above.如果我们将它包含为XCFramework或 just.framework,这是预先构建的 - 如上所述,它会失败。

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)

We've tried different combinations of macOS and Xcode, eg:我们尝试了 macOS 和 Xcode 的不同组合,例如:

Catalina with Xcode 12
BigSur with Xcode 11
etc.

Any help is greatly appreciated.任何帮助是极大的赞赏。 Thanks.谢谢。

Long story short, there were LLVM instrumentation included, which prevents AppStore processing.长话短说,其中包含 LLVM 工具,这会阻止 AppStore 处理。 I've written a whole blog post about it here - https://blog.scichart.com/xcframework-xcode-12-and-bigsur-issues/我在这里写了一篇关于它的完整博客文章 - https://blog.scichart.com/xcframework-xcode-12-and-bigsur-issues/

To sum up, here is a few required steps to make sure while creating XCFramework for distribution:总而言之,在创建XCFramework以进行分发时,需要确保以下几个步骤:

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

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.以上所有内容都有助于解决我们的准备和分发问题,如果您碰巧遇到与我们相同的问题,希望能为您节省一些时间。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Xcode12 - 为 iOS 模拟器构建,但链接为 macOS 构建的目标文件,文件 &#39;dir/SomeFile.a&#39; 用于体系结构 x86_64 - Xcode12 - building for iOS Simulator, but linking in object file built for macOS, file 'dir/SomeFile.a' for architecture x86_64 我可以使用Xcode 9和macOS Mojave将应用程序上传到iOS AppStore吗? - Can I upload an app to the iOS AppStore using Xcode 9 and macOS Mojave? Flutter iOS 在 BigSur 上构建失败,XCode 12 - Flutter iOS build failing on BigSur, XCode 12 在同一个 Xcode 项目中拥有 iOS 和 macOS 应用程序 - Having iOS and macOS app in same Xcode project NativeScript 应用程序未在真实设备中运行。 IOS14 XCODE12 - NativeScript app not running in real device. IOS14 XCODE12 如何区分仅 iOS 项目上的 iphone/ipad 和 macOS/BigSur? - How to differentiate between iphone/ipad and macOS/BigSur on an iOS only project? 适用于iOS和macOS的Swift框架 - Swift framework for iOS and macOS 什么是 Xcode12 中的任何 ios 设备(arm64)? - What is any ios device(arm64) in Xcode12? 适用于 iOS 和 MacOS X 的应用程序 - App for iOS and MacOS X 有没有办法检测 Xcode iOS/MacOS 多平台应用程序中运行的是哪个平台? - Is there a way to detect which platform is running in an Xcode iOS/MacOS Multiplatform app?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM