iOS/macOS 升级 Xcode12 和 macOS BigSur 后使用框架时应用分发失败
iOS/macOS app distribution failed while using framework after upgrading Xcode12 and macOS BigSur
我们无法分发使用我们框架的示例应用程序,我们的用户也不能。
在存档和分发到 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.
框架包含位码,或者至少在我们的 .xcconfig
中有一个 BITCODE_GENERATION_MODE = bitcode
构建设置,这基本上意味着 Xcode 将添加 -fembed-bitcode
构建标志任何 clang 调用。
从这里开始,我们开始使用 Ad-Hoc
构建进行测试,以加快我们的试错尝试,但在选择 Rebuild from bitcode
选项时也会失败。管理器显示包含以下内容的弹出窗口:
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
的片段
-= 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
在一堆警告之后显示文件末尾的实际错误(我不能包括完整的日志,因为它太多了原始文本):
code = 1061;
description = "ipatool failed with an exception: #<CmdSpec::NonZeroExitException: ...
info = {
};
level = ERROR;
type = exception;
不知道该怎么办,我尝试了不同的构建设置选项,没有任何帮助...已经联系了苹果,但还没有反馈,知道他们,我们可以等太久了...
这里的奇怪之处在于,如果我们直接将 .framework 作为源代码包含进来,然后将应用存档 - 一切都按预期进行。如果我们将它包含为 XCFramework
或只是预构建的 .framework - 它会失败,如上所述。
我可能会在这里遗漏一些简单或明显的东西,所以如果有人对此有一些见解,请告诉我。
Some system info:
macOS BigSur 11.0.1
XCode Version 12.2 (12B45b)
我们尝试了 macOS 和 Xcode 的不同组合,例如:
Catalina with Xcode 12
BigSur with Xcode 11
etc.
非常感谢任何帮助。
谢谢。
长话短说,其中包含 LLVM 检测,这会阻止 AppStore 处理。我在这里写了一整篇博客 post - https://blog.scichart.com/xcframework-xcode-12-and-bigsur-issues/
总而言之,在为分发创建 XCFramework
时需要执行以下几个必要步骤:
- 使用存档构建是必须,发布构建是不够的
BUILD_LIBRARY_FOR_DISTRIBUTION
必须设置为 YES
SKIP_INSTALL
必须设置为 NO
GCC_INSTRUMENT_PROGRAM_FLOW_ARCS = NO
关闭 GCC 工具并将它们从二进制文件中删除
CLANG_ENABLE_CODE_COVERAGE = NO
从二进制文件中关闭代码覆盖工具
以上所有内容有助于解决我们的准备和分发问题,如果您碰巧遇到与我们相同的问题,希望能为您节省一些时间。
我们无法分发使用我们框架的示例应用程序,我们的用户也不能。 在存档和分发到 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.
框架包含位码,或者至少在我们的 .xcconfig
中有一个 BITCODE_GENERATION_MODE = bitcode
构建设置,这基本上意味着 Xcode 将添加 -fembed-bitcode
构建标志任何 clang 调用。
从这里开始,我们开始使用 Ad-Hoc
构建进行测试,以加快我们的试错尝试,但在选择 Rebuild from bitcode
选项时也会失败。管理器显示包含以下内容的弹出窗口:
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
-= 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
在一堆警告之后显示文件末尾的实际错误(我不能包括完整的日志,因为它太多了原始文本):
code = 1061;
description = "ipatool failed with an exception: #<CmdSpec::NonZeroExitException: ...
info = {
};
level = ERROR;
type = exception;
不知道该怎么办,我尝试了不同的构建设置选项,没有任何帮助...已经联系了苹果,但还没有反馈,知道他们,我们可以等太久了...
这里的奇怪之处在于,如果我们直接将 .framework 作为源代码包含进来,然后将应用存档 - 一切都按预期进行。如果我们将它包含为 XCFramework
或只是预构建的 .framework - 它会失败,如上所述。
我可能会在这里遗漏一些简单或明显的东西,所以如果有人对此有一些见解,请告诉我。
Some system info:
macOS BigSur 11.0.1
XCode Version 12.2 (12B45b)
我们尝试了 macOS 和 Xcode 的不同组合,例如:
Catalina with Xcode 12
BigSur with Xcode 11
etc.
非常感谢任何帮助。 谢谢。
长话短说,其中包含 LLVM 检测,这会阻止 AppStore 处理。我在这里写了一整篇博客 post - https://blog.scichart.com/xcframework-xcode-12-and-bigsur-issues/
总而言之,在为分发创建 XCFramework
时需要执行以下几个必要步骤:
- 使用存档构建是必须,发布构建是不够的
BUILD_LIBRARY_FOR_DISTRIBUTION
必须设置为YES
SKIP_INSTALL
必须设置为NO
GCC_INSTRUMENT_PROGRAM_FLOW_ARCS = NO
关闭 GCC 工具并将它们从二进制文件中删除CLANG_ENABLE_CODE_COVERAGE = NO
从二进制文件中关闭代码覆盖工具
以上所有内容有助于解决我们的准备和分发问题,如果您碰巧遇到与我们相同的问题,希望能为您节省一些时间。