dyld: Library not loaded: @rpath/CGModule.framework/CGModule Referenced from: /private/var/containers/Bundle/Application/C637342C-51BE-4A0D-BA94-9681629BFC27/iOSTest.app/iOSTest Reason: image not found Message from debugger: Terminated due to signal 6
这个报错解决方式有两种
1.
WeChat7bc3d602a1cfef2d63a5e29394fb222d.png
在此处改成Optional
2.在Enbedded Binaries添加上.framework
后续
在项目里把.framework 的Status设置成Optional之后,我发现.framework运行时出现问题,并没有如期工作
后经查阅资料,把.framework的Status改成Required
WeChat97aec0712e84bc250b557e6cd52ad881.png
续上
如上配置之后,发现上传至appStore发生错误,报错如下
144581571219638_.pic.jpg
解决方案
APP_PATH="${TARGET_BUILD_DIR}/${WRAPPER_NAME}" # This script loops through the frameworks embedded in the application and # removes unused architectures. find "$APP_PATH" -name '*.framework' -type d | while read -r FRAMEWORK do FRAMEWORK_EXECUTABLE_NAME=$(defaults read "$FRAMEWORK/Info.plist" CFBundleExecutable) FRAMEWORK_EXECUTABLE_PATH="$FRAMEWORK/$FRAMEWORK_EXECUTABLE_NAME" echo "Executable is $FRAMEWORK_EXECUTABLE_PATH" EXTRACTED_ARCHS=() for ARCH in $ARCHS do echo "Extracting $ARCH from $FRAMEWORK_EXECUTABLE_NAME" lipo -extract "$ARCH" "$FRAMEWORK_EXECUTABLE_PATH" -o "$FRAMEWORK_EXECUTABLE_PATH-$ARCH" EXTRACTED_ARCHS+=("$FRAMEWORK_EXECUTABLE_PATH-$ARCH") done echo "Merging extracted architectures: ${ARCHS}" lipo -o "$FRAMEWORK_EXECUTABLE_PATH-merged" -create "${EXTRACTED_ARCHS[@]}" rm "${EXTRACTED_ARCHS[@]}" echo "Replacing original executable with thinned version" rm "$FRAMEWORK_EXECUTABLE_PATH" mv "$FRAMEWORK_EXECUTABLE_PATH-merged" "$FRAMEWORK_EXECUTABLE_PATH" done
此段js功能在于剥夺framework中的架构
添加后,报错消失。