Ionic 4 running app on iOS device error with capacitor

I have an ionic 4 project with capacitor. I tried to open and build an iOS version. The Xcode successfully build and install the app. But when the app is running it freezes at splash screen and I get this error on Xcode log:

dyld: Library not loaded: @rpath/Capacitor.framework/Capacitor
  Referenced from: /var/containers/Bundle/Application/F39FC29D-255C-4BED-B6D5-6FEF4979C5F5/App.app/App
  Reason: no suitable image found.  Did find:
    /private/var/containers/Bundle/Application/F39FC29D-255C-4BED-B6D5-6FEF4979C5F5/App.app/Frameworks/Capacitor.framework/Capacitor: code signature in (/private/var/containers/Bundle/Application/F39FC29D-255C-4BED-B6D5-6FEF4979C5F5/App.app/Frameworks/Capacitor.framework/Capacitor) not valid for use in process using Library Validation: mapped file has no Team ID and is not a platform binary (signed with custom identity or adhoc?)
    /private/var/containers/Bundle/Application/F39FC29D-255C-4BED-B6D5-6FEF4979C5F5/App.app/Frameworks/Capacitor.framework/Capacitor: code signature in (/private/var/containers/Bundle/Application/F39FC29D-255C-4BED-B6D5-6FEF4979C5F5/App.app/Frameworks/Capacitor.framework/Capacitor) not valid for use in process using Library Validation: mapped file has no Team ID and is not a platform binary (signed with custom identity or adhoc?)
    /private/var/containers/Bundle/Application/F39FC29D-255C-4BED-B6D5-6FEF4979C5F5/App.app/Frameworks/Capacitor.framework/Capacitor: stat() failed with errno=1
    /private/var/containers/Bundle/Application/F39FC29D-255C-4BED-B6D5-6FEF4979C5F5/App.app/Frameworks/Capacitor.framework/Capacitor: code signature in (/private/var/containers/Bundle/Application/F39FC29D-255C-4BED-B6D5-6FEF4979C5F5/App.app/Frameworks/Capacitor.framework/Capacitor) not valid for use in process using Library Validation: mapped file has no Team ID and is not a platform binary (signed with custom identity or adhoc?)
    /private/var/containers/Bundle/Application/F39FC29D-255C-4BED-B6D5-6FEF4979C5F5/App.app/Frameworks/Capacitor.framework/Capacitor: stat() failed with errno=1

I already check the automatic signing in the capabilities section to allow Xcode to do all necessary signing operations. But all solution is not working for me and I get this message always. My Xcode version is 10.2.1 and I have to mention that app is correctly running on Xcode iOS simulators.

Please help me, It’s 2 days that I’m struggling with this error!

Thanks

Hey. Did you figure this out? I have a similar problem but with a slightly different error message. It happened after I upgraded to the latest xcode (11.4)

dyld: Library not loaded: @rpath/protobuf.framework/protobuf

Referenced from: /private/var/containers/Bundle/Application/E7C9338E-3E30-47AF-A38C-9BC5FA3A4A28/FoxtechNews.app/FoxtechNews

Reason: image not found

(lldb)

Hi, I didn’t find any solution!

I know! I know!

Deleting build cache helped me. I clicked “Product / Clean build folder” and then it magically worked! Aye aye XCode gods!

This doesn’t work for me!

Hello, did you manage to resolve the issue? I am having exact same problem

Hi,
Unfortunately I came back to Cordova for this and other issues with the capacitor at that time.