Reason: no suitable image found
I searched long on this issue. There are several reasons causes this issue.
If you are facing when you and Swift code/library in an Objectice C project you should try Solution 1-2-3
If you are facing this issue with a new a Swift project Solution 4 will fit you best.
Solution 1:
Restart Xcode, then computer and iPhone
Solution 2:
Go to project build settings and set Embedded Content Contains Swift
Code flag to YES
Solution 3:
Go to project build settings and add @executable_path/Frameworks
to Runpath Search Paths option
Solution 4:
If none of above works, this should. Apple seems to be ninja patched certificates as mentioned in AirSign's post
At InHouse certificates
Subject: UID=269J2W3P2L, CN=iPhone Distribution: Company Name, O=Company Name, C=FR
they added a new field named OU
Subject: UID=269J2W3P2L, CN=iPhone Distribution: Company Name, OU=269J2W3P2L, O=Company Name, C=FR
so you should just recreate certificate and provision
Xcode->Product->Clean + Xcode Restart
After attempting many of the other mentioned solutions, to my eternal embarrassment, doing an Xcode->Product->Clean and restarting Xcode, did the trick.
I have this problem before for accidentally revoked my certificate. Then all my swift projects have this problem. There are two ways to solve this:
Click on Product → Clean (or CMD + Shift + K)
Or by manually cleaning the Xcode setting files:
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