问题
The Xcode 9.2 I was unable to run my application on my device, I can run it only on simulator and this the same for all my project ( Objective - C / Swift ) Some of my project runs with cocoapods and some without but also not running on Devices.
I tried everything .
• Deleted All Xcode Verisons
• Cleared Cache
• Cleared DerivedData
• Restarted my laptop
• Update OS
• Installed a fresh version of Xcode 9.2 from the app store
• Delete /Library/Preferences/com.apple.dt.Xcode.plist
• Delete ~/Library/Preferences/com.apple.dt.Xcode.plist
• Delete ~/Library/Caches/com.apple.dt.Xcode
• Delete ~/Library/Application Support/Xcode
• rm -rf "$(getconf DARWIN_USER_CACHE_DIR)/org.llvm.clang/ModuleCache"
• rm -rf ~/Library/Developer/Xcode/DerivedData
• rm -rf ~/Library/Caches/com.apple.dt.Xcode
• Reinstalling the WWDR Certificate
• Verified that the path has: @executable_path/Frameworks
• Test with Bitcode: YES and NO
• Put in "Always Trust" mode the apple certs.
• opened my project and run on device still getting the following error :
1. dyld: Library not loaded: @rpath/libswiftCore.dylib
2. Referenced from: /var/mobile/Containers/Bundle/Application/C92037D1-A936-4070-9E61-BF5DB00780D7/ProblemApp.app/ProblemApp
3. Reason: no suitable image found. Did find:
4. /private/var/mobile/Containers/Bundle/Application/C92037D1-A936-4070-9E61-BF5DB00780D7/ProblemApp.app/Frameworks/libswiftCore.dylib: mmap() errno=1 validating first page of '/private/var/mobile/Containers/Bundle/Application/C92037D1-A936-4070-9E61-BF5DB00780D7/ProblemApp.app/Frameworks/libswiftCore.dylib'
I have almost spend one week please help me.
Thanks!
Shiv Sharma
回答1:
It's likely related to this since you have a mixed language project.
Try setting Embedded Content Contains Swift Code to YES
回答2:
make the "Always Embed Swift standard libraries" from NO to YES.
Let me know if it works for you.
回答3:
Check all frameworks you add to your application. Probably one of them needs to be added to the 'Enbedded Binaries' section on the General page of the main target. For example, Zip.Framework.
来源:https://stackoverflow.com/questions/48081374/unable-to-run-application-on-device-dyld-library-not-loaded