When trying to run my app in the Xcode simulator it runs successfully, but when I try to run my app on my iPhone this is the error message I keep getting:
dyld: Library not loaded: @rpath/AvailableHapticFeedback.framework/AvailableHapticFeedback
Referenced from: /private/var/containers/Bundle/Application/CAFEEAC3-7D4A-4188-926A-5E90DEF449BC/MyApp.app/MyApp
Reason: no suitable image found.
Did find:
/private/var/containers/Bundle/Application/CAFEEAC3-7D4A-4188-926A-5E90DEF449BC/MyApp.app/Frameworks/AvailableHapticFeedback.framework/AvailableHapticFeedback:
code signature invalid for '/private/var/containers/Bundle/Application/CAFEEAC3-7D4A-4188-926A-5E90DEF449BC/MyApp.app/Frameworks/AvailableHapticFeedback.framework/AvailableHapticFeedback'
/private/var/containers/Bundle/Application/CAFEEAC3-7D4A-4188-926A-5E90DEF449BC/MyApp.app/Frameworks/AvailableHapticFeedback.framework/AvailableHapticFeedback:
code signature invalid for '/private/var/containers/Bundle/Application/CAFEEAC3-7D4A-4188-926A-5E90DEF449BC/MyApp.app/Frameworks/AvailableHapticFeedback.framework/AvailableHapticFeedback'
/private/var/containers/Bundle/Application/CAFEEAC3-7D4A-4188-926A-5E90DEF449BC/MyApp.app/Frameworks/AvailableHapticFeedback.framework/AvailableHapticFeedback:
stat() failed with errno=1
/private/var/containers/Bundle/Application/CAFEEAC3-7D4A-4188-926A-5E90DEF449BC/MyApp.app/Frameworks/AvailableHapticFeedback.framework/AvailableHapticFeedback:
code signature invalid for '/private/var/containers/Bundle/Application/CAFEEAC3-7D4A-4188-926A-5E90DEF449BC/MyApp.app/Frameworks/AvailableHapticFeedback.framework/AvailableHapticFeedback'
/private/var/containers/Bundle/Application/CAFEEAC3-7D4A-4188-926A-5E90DEF449BC/MyApp.app/Frameworks/AvailableHapticFeedback.framework/AvailableHapticFeedback: stat() failed with errno=1
/private/var/containers/Bundle/Application/CAFEEAC3-7D4A-4188-926A-5E90DEF449BC/MyApp.app/Frameworks/AvailableHapticFeedback.framework/AvailableHapticFeedback:
code signature invalid for '/private/var/containers/Bundle/Application/CAFEEAC3-7D4A-4188-926A-5E90DEF449BC/MyApp.app/Frameworks/AvailableHapticFeedback.framework/AvailableHapticFeedback'
/private/var/containers/Bundle/Application/CAFEEAC3-7D4A-4188-926A-5E90DEF449BC/MyApp.app/Frameworks/AvailableHapticFeedback.framework/AvailableHapticFeedback: stat() failed with errno=1
I'm currently using Xcode Version 11.3.1 (11C504) I've tried:
Clean Build Folder
Restarting Xcode
Restarting the MacBook
- Restarting the iPhone
- Trying it on an iMac
Updating the MacBooks operating system
Xcode is up to date.
- Checked Runpath Search Paths: $inherited @executable_path/Frameworks @loader_path/Frameworks
Build Options - Always Embed Swift Standard Libraries = YES
Deleting the Derived Data folder and trying again.
- Clearing out my Keychain
- My Apple Development certificate is set to 'Use System Defaults'
I've downloaded the AppleWWDRCA.cer and installed it.
I've tried updating the pod file and installing those again.
I've also run the following commands in Terminal:
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
- In the Target > General Build Settings > Frameworks, Libraries, and
Embedded Content I have Pods_MyApp.framework, under 'Embed' I've
changed it from 'Do not embed' to 'Embed & Sign', neither were
successful. I tried adding the AvailableHapticFeedback framework explicitly in the 'Frameworks, Libraries, and Embedded Content', but Xcode complains of a duplicate, so removed it.
I've made sure there is no value in the Packaging section -
'Executable Prefix'
Can anyone suggest anything else to help me fix this issue, please?