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
這個(gè)報(bào)錯(cuò)解決方式有兩種
在此處改成Optional
2.在Enbedded Binaries添加上.framework
后續(xù)
在項(xiàng)目里把.framework 的Status設(shè)置成Optional之后,我發(fā)現(xiàn).framework運(yùn)行時(shí)出現(xiàn)問題,并沒有如期工作
后經(jīng)查閱資料,把.framework的Status改成Required
續(xù)上
如上配置之后,發(fā)現(xiàn)上傳至appStore發(fā)生錯(cuò)誤,報(bào)錯(cuò)如下
解決方案
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中的架構(gòu)
添加后,報(bào)錯(cuò)消失靡砌。