Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

After updating iOS, all applications using the framework stopped running on the device, but they run on the simulator

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) 
}
like image 270
megapihar Avatar asked Feb 03 '20 18:02

megapihar


People also ask

How do you simulate an iPhone on a Mac?

Simulating Different iOS Devices Open the iOS simulator, if it's not already open. From the Hardware menu, select Device, and then select the type of device you want to simulate. The simulator window will change to match the dimensions of the device you selected.

What is framework in iOS?

A framework is a hierarchical directory that encapsulates shared resources, such as a dynamic shared library, nib files, image files, localized strings, header files, and reference documentation in a single package. Multiple applications can use all of these resources simultaneously.

How do I run an Xcode emulator?

Open Xcode and click Menu > Xcode > Preferences > Select Components, and then choose the simulator version you want to download. When a simulator is opened from AppStudio, AppStudio Player automatically installs (if necessary) and opens in it.

How do I open iOS simulator?

The basic way to open a list of simulators is to use Xcode -> Window -> Devices and Simulators. Here you can create and manage all available simulators.


2 Answers

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

like image 144
NateMS Avatar answered Oct 04 '22 00:10

NateMS


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

like image 34
Julia Pak Avatar answered Oct 04 '22 02:10

Julia Pak