Realm-cocoa: dyld: Library not loaded: @rpath/Realm.framework/Realm error with Realm Objective C framework

Created on 7 Nov 2016  路  6Comments  路  Source: realm/realm-cocoa

Hi,

I have installed the Realm Objective C Framework (2.0.3) by simply dragging it into my project created in Xcode 8. When I first tried it on simulator I got the typical dyld error.

dyld: Library not loaded: @rpath/Realm.framework/Realm
  Referenced from: /var/containers/Bundle/Application/89F5987A-F3F0-45F2-9014-6BA662135E00/RelamDemo.app/RelamDemo
  Reason: image not found

So I tried to fix it using the following suggestion:
https://github.com/realm/realm-cocoa/issues/1681#issuecomment-120749962

In my case I only added Realm.framework. And it worked on iOS 10 Simulators.

But when I tried to run the same project on a device (iOS 10/9.3.2) I got the same dyld error again.

I have checked that I have copied the Realm.framework in my project. Now how can I solve the problem?

Realm version: 2.0.3

Xcode version: Xcode 8

iOS/OSX version: 10, 9.3.2

MacOS : 10.12

T-Help

Most helpful comment

Make sure you dragged Realm.framework to the "Embedded Binaries" section in your project's General settings tab. Also make sure you have "Embed Frameworks" build phase and Realm.framework is included there.

Installation section in documentation should be also helpful.

All 6 comments

Make sure you dragged Realm.framework to the "Embedded Binaries" section in your project's General settings tab. Also make sure you have "Embed Frameworks" build phase and Realm.framework is included there.

Installation section in documentation should be also helpful.

That worked. Thanks.

just in case if anyone needs. I compiled static libraries with Xcode 9.1 swift 4.0.2 here https://github.com/amirpervaiz086/Realm-swift-4.0.2

@stel that works , thanks

I had the same issue in Xcode 11.4 and I fixed it by editing my pod file to:

platform :ios, '13.0'

target 'YourTarget' do
  #use_frameworks! -> !!! very important

  pod 'Realm', :modular_headers => true
  pod 'RealmSwift', :modular_headers => true

end

I fixed it by changing Embed preferences from Do Not Embed to Embed & Sign.
Screenshot 2020-05-06 at 10 20 31 PM

Was this page helpful?
0 / 5 - 0 ratings

Related issues

matteodanelli picture matteodanelli  路  3Comments

dennisgec picture dennisgec  路  3Comments

javierjulio picture javierjulio  路  3Comments

jpsim picture jpsim  路  3Comments

fadylateef picture fadylateef  路  3Comments