0
votes

i added a framework that i developed in ios to the new project. I tried to make the app universal (one framework work both in device and simulator) according to this tutorial create an ios universal framework . When i run my demo project using this universal framework i get this errors

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

Referenced from: /private/var/mobile/Containers/Bundle/Application/DDF71B22-F535-43E5-B770-D3425419B108/DemoSDk2.app/Frameworks/#######.framework/######### Reason: no suitable image found. Did find: /private/var/mobile/Containers/Bundle/Application/DDF71B22-F535-43E5-B770-D3425419B108/DemoSDk2.app/Frameworks/########.framework/Frameworks/Realm.framework/Realm: mmap() errno=1 validating first page of '/private/var/mobile/Containers/Bundle/Application/DDF71B22-F535-43E5-B770-D3425419B108/DemoSDk2.app/Frameworks/##########.framework/Frameworks/Realm.framework/Realm'

both in device and simulator the demo app crash

2

2 Answers

0
votes

Dynamic frameworks are by definition not statically linked into binaries that link them.

This means dynamic frameworks must be shipped with the binaries that link them.

The typical way to do this for iOS apps is to have a build phase to copy the framework into your app bundle after compilation.

0
votes

Due to restrictions by Apple for app store deployment it is not possible to dynamically link frameworks. This is an issue that is common amongst frameworks and not specific to Realm.

The following link is from Realm's GitHub discussion and explains in further detail and offers some work arounds (though none are particularly elegant.

https://github.com/realm/realm-cocoa/issues/3051