iOS编译失败问题总结

在开发过程经常会遇到各种各样的报错问题,在此记录方便以后查阅 也给出现相同问题的伙伴一点思路。

问题1. 启动app崩溃 报错如下:

dyld: Library not loaded: @rpath/App.framework/App
Referenced from: /Users/XXX/Library/Developer/CoreSimulator/Devices/4AD13456-EB2E-4B89-8402-1B32914599DC/data/Containers/Bundle/Application/236DC619-7B0C-4293-ADBF-9B21986F3879/xxx.app/xxx
Reason: image not found
dyld: launch, loading dependent libraries
DYLD_SHARED_CACHE_DIR=/Users/zhangbeibei4/Library/Developer/CoreSimulator/Caches/dyld/20G80/com.apple.CoreSimulator.SimRuntime.iOS-14-2.18B79
DYLD_ROOT_PATH=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot
DYLD_LIBRARY_PATH=/Users/xxx/Library/Developer/Xcode/DerivedData/xxx-fxdbdflsqnzzdxbhlcllflspvmcg/Build/Products/Debug-iphonesimulator:/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/usr/lib/system/introspection
DYLD_INSERT_LIBRARIES=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/usr/lib/libBacktraceRecording.dylib:/Applications/Xcode_12.2.app/Contents/Developer/Platforms/iPhoneOS.p

解决方案
在Pods-xxx-frameworks.sh中添加

 install_framework "${PODS_ROOT}/gm_bangbang_module/ios_lib/bin/App.framework"

如图:


1639985288847.jpg

问题2:The document “math.h” could not be saved. You don’t have permission.

原因是不小心修改了系统文件
解决方案如下:
Xcode-preferences-Locations打开下面的窗口,删除DerivedData这个文件夹


image.png

强制退出Xcode(command+option+shift+esc)再重新打开就可以了

你可能感兴趣的:(iOS编译失败问题总结)