我制作了自己的胖框架,并在Cocoapods上分发。
但是当我尝试上传使用我的框架启用了位码的应用程序时,由于错误ITMS-90635而被拒绝,请参阅:
我希望我的框架与位码兼容,因此在构建框架时设置了ENABLE_BITCODE=YES
,BITCODE_GENERATION_MODE=bitcode
(也尝试了OTHER_CFLAGS="-fembed-bitcode"
)。
这是我构建框架的方式:
[...]
echo "Clean ${TARGET_NAME} for simulator"
xcodebuild -workspace ${WORKSPACE_NAME}.xcworkspace -destination 'platform=iOS Simulator,name=iPhone 6,OS=latest' -scheme ${SCHEME} CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO ENABLE_BITCODE=YES BITCODE_GENERATION_MODE=bitcode clean
echo "Clean ${TARGET_NAME} for generic device"
xcodebuild -workspace ${WORKSPACE_NAME}.xcworkspace -configuration ${CONFIGURATION} -destination generic/platform=iOS -scheme ${SCHEME} CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO ENABLE_BITCODE=YES BITCODE_GENERATION_MODE=bitcode clean
echo "Build ${WORKSPACE_NAME} for simulator"
xcrun xcodebuild -workspace ${WORKSPACE_NAME}.xcworkspace -scheme ${SCHEME} -configuration ${CONFIGURATION} -destination 'platform=iOS Simulator,name=iPhone 6,OS=latest' -sdk iphonesimulator CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO ENABLE_BITCODE=YES BITCODE_GENERATION_MODE=bitcode
echo "Build ${WORKSPACE_NAME} for generic device"
xcrun xcodebuild -workspace ${WORKSPACE_NAME}.xcworkspace -scheme ${SCHEME} -configuration ${CONFIGURATION} -destination generic/platform=iOS -sdk iphoneos CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO ENABLE_BITCODE=YES BITCODE_GENERATION_MODE=bitcode
[...]
lipo -create "${DEVICE_BIN}/${TARGET_NAME}" "${SIMULATOR_BIN}/${TARGET_NAME}" -output "${UNIVERSAL_PATH}/${TARGET_NAME}.framework/${TARGET_NAME}"
我真的不明白我的框架似乎启用了位码,请参阅:
构建框架时我做错什么了吗?
答案 0 :(得分:0)
好吧,我终于找到了问题所在:)
(* 1 1000000)
完成后,我曾经复制/粘贴
lipo
进入
Build/Products/Release-iphoneos/MyFramework.framework/Modules/MyFramework.swiftmodule/
然后我分发了这个最终框架:
Build/Products/Release-iphonesimulator/MyFramework.framework/Modules/MyFramework.swiftmodule/
。
做相反的事情! Build/Products/Release-iphonesimulator/MyFramework.framework
完成后,将lipo
的{{1}}复制/粘贴到MyFramework.swiftmodule/
中,并将.framework分发到Release-iphonesimulator/
中。