swift - Sharing realm between containing app and extension -


i sharing realm between containing app , extension (custom keyboard), , works ok on simulator, when i'm trying run app on real device have following error:

cannot load underlying module 'realmswift'

it's kinda strange not issue simulator ok. let's add pods.framework link binary libraries extension.

.../pods/bolts/bolts/common/bfcancellationtokenregistration.h:19:1: duplicate interface definition class 'bfcancellationtokenregistration'

ok. let's remove it.

cannot load underlying module 'realmswift'

can't argue that. let's try add realmswift.framework extension.

.../pods/bolts/bolts/common/bfcancellationtokenregistration.h:19:1: duplicate interface definition class 'bfcancellationtokenregistration'

ok. after several iterations there several pods.framework in project folder , realmswift.framework too. let's remove them except 1 pods.framework. let's change target membership framework app , extension.

.../pods/bolts/bolts/common/bfcancellationtokenregistration.h:19:1: duplicate interface definition class 'bfcancellationtokenregistration'

and

cannot load underlying module 'realmswift'

together.

how fixed?

update: using realm , parse cocoapods.

it should matter of creating second section in podfile let specify dependencies app extension main app.

target 'myapp'    pod 'realmswift' end  target 'myappextension'    pod 'realmswift' end 

cocoapods lot of steps in setting dependencies , installing them target @ compile time, don't think copying pods.framework extensions build steps work.

if you've got multiple references same files floating around, may idea delete every cocoapods-related file/folder project, , running pod install again make sure it's set again properly.

let me know how go!


Comments