14

error:
{ dyld: Library not loaded: @rpath/Realm.framework/Realm Referenced from: /private/var/containers/Bundle/Application/43190AF8-F437-4B8F-9827-DDEA599AF618/Favorite Places.app/Favorite Places Reason: no suitable image found. Did find: /private/var/containers/Bundle/Application/43190AF8-F437-4B8F-9827-DDEA599AF618/Favorite Places.app/Frameworks/Realm.framework/Realm: code signature invalid for '/private/var/containers/Bundle/Application/43190AF8-F437-4B8F-9827-DDEA599AF618/Favorite Places.app/Frameworks/Realm.framework/Realm'

    /private/var/containers/Bundle/Application/43190AF8-F437-4B8F-9827-DDEA599AF618/Favorite Places.app/Frameworks/Realm.framework/Realm: stat() failed with errno=25
    /private/var/containers/Bundle/Application/43190AF8-F437-4B8F-9827-DDEA599AF618/Favorite Places.app/Frameworks/Realm.framework/Realm: code signature invalid for '/private/var/containers/Bundle/Application/43190AF8-F437-4B8F-9827-DDEA599AF618/Favorite Places.app/Frameworks/Realm.framework/Realm'

    /private/var/containers/Bundle/Application/43190AF8-F437-4B8F-9827-DDEA599AF618/Favorite Places.app/Frameworks/Realm.framework/Realm: stat() failed with errno=1
    /private/var/containers/Bundle/Application/43190AF8-F437-4B8F-9827-DDEA599AF618/Favorite Places.app/Frameworks/Realm.framework/Realm: code signature invalid for '/private/var/containers/Bundle/Application/43190AF8-F437-4B8F-9827-DDEA599AF618/Favorite Places.app/Frameworks/Realm.framework/Realm'

    /private/var/containers/Bundle/Application/43190AF8-F437-4B8F-9827-DDEA599AF618/Favorite Places.app/Frameworks/Realm.framework/Realm: stat() failed with errno=1
(lldb) 
}
megapihar
  • 143
  • 1
  • 6
  • That sounds like a code signing issue. In the Xcode navigator on the left, select the first item, which should be your project name, then on the right side select Signing and Capabilities, make sure your Team and Signing Certificate are filled in correctly. You may need to go to the Xcode->Preferences and sign in again. – Jay Feb 03 '20 at 20:36
  • Everything is fine there(( – megapihar Feb 04 '20 at 11:36
  • I re-logged into my account several times. I even did a MacBook reset – megapihar Feb 04 '20 at 11:45
  • Did you clean (SHIFT + CMD + K or Product->Clean Build Folder) and rebuild? Once you do that, restart. If that doesn't help, ensure you have the most current versions of RealmSwift. – Jay Feb 04 '20 at 15:52

7 Answers7

24

I had the same issue with realm, it would work on the simulator but crash instantly on the actual devices. It seems when updating to iOS 13.3.1 Apple changed the behaviour of free apple developer accounts, no longer allowing them to use embedded frameworks.

The solution is to remove the use_frameworks! in your Podfile and replace it with use_modular_headers!

e.g.

target 'your_project_name' do
    use_modular_headers!
    pod 'RealmSwift'
end

This will include them as static libraries instead. I stumbled upon the solution in this GitHub issue: https://github.com/Alamofire/Alamofire/issues/3051

NateMS
  • 374
  • 2
  • 4
  • 1
    @megapihar This is a good answer taken from the GitHub issue re: AlamoFire but careful with this as it will break other podfiles. I tried this myself and Firebase no longer works. – Jay Feb 04 '20 at 19:01
  • yeah, its right. but this is the only thing that can help – megapihar Feb 05 '20 at 18:51
  • @megapihar I’ve been experiencing this same issue this entire week and haven’t been able to progress with my app development at all (as I want to use my physical device for testing). I have a free developer account and am using cocoapods. The framework causing the issue is FBLPromises which appears to be a part of Firebase cocoapods. Since commenting out use_frameworks! In my Podfile breaks my Firebase pods, is there any way around it since I DO need Firebase? – Justin Feb 17 '20 at 04:48
  • 1
    @megapihar I am facing the same problem. As of right now, I don't think there are any 'free account' workarounds for this. I have submitted bug reports to both Apple and Firebase; I'll keep SO updated on any developments. – Vedant Feb 23 '20 at 20:09
  • Can you please tell me the location of the podfile? –  Feb 25 '20 at 00:26
  • 1
    Firebase is treating this as an iOS issue and does not plan to release a fix. Let's hope iOS 13.3.2 fixes the issue. No news from Apple so far. – Vedant Feb 27 '20 at 09:40
2

Welp I faced a very similar problem. Did not need to pay my developer account renewal. Yup I'm currently on a free account. Updating to 13.4 and xcode 11.4 still was showing the same issue. So this is what I did:

-Deleted app off phone, cleaned build and removed old profiles(found in

~/Library/MobileDevice/Provisioning Profiles)

-Deleted everything in "iOS DeviceSupport" file found in

~/Library/Developer

-Cleaned derived data.

-In keychain I deleted all my certificates.

Also removed my account and re-added it upon re-starting xcode (IMO this might have done nothing, but worth adding). Restarted phone and xcode. App is up and running on my phone now! No paid developer account! Oh and podfile...

platform :ios, '13.2'

target 'YourApp' do
  use_frameworks!
  pod 'Mapbox-iOS-SDK', '~> 5.7.0'

 
 target 'WalkBuddyTests' do
    inherit! :search_paths
    #pods for testing
end
end

Community
  • 1
  • 1
Julia Pak
  • 475
  • 6
  • 19
  • These steps helped to me after buying payed account (at first it didn't want to work on Xcode 11.3 – Paul T. May 19 '20 at 10:49
0

Removing use_frameworks. It will break your Firebase pods. For projects that utilize Firebase pods, your solutions consist of the following..

  1. Downgrade your iOS device
  2. Create & pay for an Apple Developer Program
  3. Use the simulator and wait for future iOS updates that will hopefully once again allow free dev accounts to use Frameworks again..

This is very often issue which needs to be eliminated by official sources

W Dyson
  • 4,604
  • 4
  • 40
  • 68
0

Comment use_frameworks, then use use_modular_headers! instead.

#use_frameworks!

use_modular_headers!

# Pods for NoteWithFireStore

pod 'BoringSSL-GRPC'

pod 'Firebase/Analytics'

pod 'Firebase/Firestore'

pod 'Firebase/Storage'

pod 'BoringSSL-GRPC', '= 0.0.3', :modular_headers => false

pod 'gRPC-Core', '= 1.21.0', :modular_headers => false

tried on Xcode 11.4 and iOS 13.4 with Firebase and free develop account. This combination fix the issue

pie3636
  • 795
  • 17
  • 31
Alice Ma
  • 1
  • 1
0

I have been facing the same problem... It got fixed by adding:

In you podfile:

use_modular_headers!

instead of

use_frameworks!

Good luck! I hope this works for you!

XtremeDevX
  • 1,482
  • 2
  • 13
  • 38
0

Same problem. Solved just by recreating the profile.

mark
  • 851
  • 1
  • 8
  • 5
0

I had enabled the "Hardened Runtime" for a MacOS app, but didn't enable "Disable Library Validation", hence I couldn't load external libraries.

enter image description here

Alberto M
  • 1,608
  • 1
  • 18
  • 42