dyld: Library not loaded:解决办法

简介: dyld: Library not loaded:解决办法
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.

image.png

WeChat7bc3d602a1cfef2d63a5e29394fb222d.png


在此处改成Optional

2.在Enbedded Binaries添加上.framework

后续

在项目里把.framework 的Status设置成Optional之后,我发现.framework运行时出现问题,并没有如期工作

后经查阅资料,把.framework的Status改成Required


image.png

WeChat97aec0712e84bc250b557e6cd52ad881.png

续上

如上配置之后,发现上传至appStore发生错误,报错如下

image.png

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中的架构

添加后,报错消失。

相关文章
|
Ubuntu Linux 编译器
如何解决使用libevent时的共享库加载问题“error while loading shared libraries: libevent-2.1.so.7: cannot open ...“
如何解决使用libevent时的共享库加载问题“error while loading shared libraries: libevent-2.1.so.7: cannot open ...“
360 0
|
Linux
linux运行protoc出现错误 while loading shared libraries: libprotoc.so.19
linux运行protoc出现错误 while loading shared libraries: libprotoc.so.19
146 0
|
Android开发
【错误记录】NDK 动态库报错 ( dlopen failed: file offset for the library /lib/arm64/libwebp.so“ >= file size:0)
【错误记录】NDK 动态库报错 ( dlopen failed: file offset for the library /lib/arm64/libwebp.so“ >= file size:0)
463 0
【错误记录】NDK 动态库报错 ( dlopen failed: file offset for the library /lib/arm64/libwebp.so“ >= file size:0)
dyld Library not loaded Reason image not found 问题解决
添加第三方框架,然后启动app的时候会,提示dyld: Library not loaded: Reason: image not found 网上大部分的做法都是把Build Phases 里对应framework后边的选项修改成为Optional,但这个是治标不治本,还是没法解决问题
212 0
如何解决:./real.exe: error while loading shared libraries: libhdf5hl_fortran.so.100: cannot open shared
如何解决:./real.exe: error while loading shared libraries: libhdf5hl_fortran.so.100: cannot open shared
如何解决:./real.exe: error while loading shared libraries: libhdf5hl_fortran.so.100: cannot open shared
|
C语言
编译OpenJDK8:configure error /usr/lib64/ccache/gcc is a symbolic link to ccache
编译OpenJDK8:configure error /usr/lib64/ccache/gcc is a symbolic link to ccache
127 0
错误解决:当前目录下有so,提示 error while loading shared libraries
错误解决:当前目录下有so,提示 error while loading shared libraries
95 0
|
Linux
Linux操作系统下proj4库编译与安装及ERROR 6: Unable to load PROJ.4 library (libproj.so)问题解决
Linux操作系统下proj4库编译与安装及ERROR 6: Unable to load PROJ.4 library (libproj.so)问题解决
916 0
成功解决OSError: dlopen() failed to load a library: cairo / cairo-2 / cairo-gobject-2 / cairo.so.2
成功解决OSError: dlopen() failed to load a library: cairo / cairo-2 / cairo-gobject-2 / cairo.so.2
成功解决OSError: dlopen() failed to load a library: cairo / cairo-2 / cairo-gobject-2 / cairo.so.2

热门文章

最新文章