Skip to content

ObjectBox.framework not found when using Flutter Module in Native iOS App (Add-to-App) #785

@HyperlinkKishanr

Description

@HyperlinkKishanr

When integrating a Flutter module that uses ObjectBox into a native iOS application using CocoaPods, the app crashes at runtime with a dynamic linker error indicating that ObjectBox.framework cannot be found.

Error Message

Library not loaded: @rpath/ObjectBox.framework/ObjectBox
  Referenced from: <2094CC38-265D-3112-814E-956C86962AF9> /private/var/containers/Bundle/Application/47CA2271-9611-439D-80C3-8BFF44104E54/iVESTOR-UAT.app/Frameworks/objectbox_flutter_libs.framework/objectbox_flutter_libs
  Reason: tried: '/usr/lib/swift/ObjectBox.framework/ObjectBox' (no such file, not in dyld cache), '/private/preboot/Cryptexes/OS/usr/lib/swift/ObjectBox.framework/ObjectBox' (no such file), '/private/var/containers/Bundle/Application/47CA2271-9611-439D-80C3-8BFF44104E54/iVESTOR-UAT.app/Frameworks/ObjectBox.framework/ObjectBox' (no such file), '/private/var/containers/Bundle/Application/47CA2271-9611-439D-80C3-8BFF44104E54/iVESTOR-UAT.app/Frameworks/objectbox_flutter_libs.framework/Frameworks/ObjectBox.framework/ObjectBox' (no such file)

Expected Behavior
The ObjectBox.framework should be properly embedded in the app bundle and loaded successfully at runtime, allowing the Flutter module to use ObjectBox without errors.

Actual Behavior
The ObjectBox.framework is not found in the app bundle, causing a runtime crash. The dynamic linker searches multiple paths but cannot locate the framework, even though objectbox_flutter_libs.framework is present.

Questions

Is ObjectBox officially supported in Flutter "Add-to-App" scenarios?
->Does ObjectBox support being used in a Flutter module that's integrated into a native iOS app?

How should ObjectBox.framework be packaged in a Flutter module?
-> Should it be included in the Flutter module's xcframework?
-> Should it be declared as a dependency in the module's podspec?

Are there any known limitations or workarounds?
-> Is there specific configuration needed for Add-to-App scenarios?
-> Should we use platform channels and native ObjectBox Swift SDK instead?

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingmore info requiredNeeds more info to become actionable. Auto-closed if no response.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions