用纯Swift程序真机调试,出现以下异常,在模拟器可以跑,用OC写的也可以跑,为什么
dyld: Library not loaded: @rpath/libswiftCore.dylib Referenced from: /private/var/mobile/Containers/Bundle/Application/930B04BF-8608-4075-A3B9-7FE2669F02BC/myTry.app/myTry Reason: no suitable image found. Did find: /private/var/mobile/Containers/Bundle/Application/930B04BF-8608-4075-A3B9-7FE2669F02BC/myTry.app/Frameworks/libswiftCore.dylib: mmap() error 1 at address=0x1000F4000, size=0x0018C000 segment=__TEXT in Segment::map() mapping /private/var/mobile/Containers/Bundle/Application/930B04BF-8608-4075-A3B9-7FE2669F02BC/myTry.app/Frameworks/libswiftCore.dylib
解决方法:
- 退出 Xcode
- 重启电脑
- 找到 这个 DerivedData 文件夹 删除 (路径: ~/Library/Developer/Xcode/DerivedData)
- 删除这个 com.apple.dt.Xcode 文件 (路径: ~/Library/Caches/com.apple.dt.Xcode)
然后 在运行 Xcode 就好了~~
网友评论