I set up an Objectbox db for my flutter app following the instructions here - https://docs.objectbox.io/getting-started - and it worked a treat. Fast, easy, and no issues at all when deployed to to various Android devices. Different story on iOS: app crashes immediately, with the following error:
(lldb) dyld[10127]: Library not loaded: @rpath/ObjectBox.framework/ObjectBox
Referenced from: /private/var/containers/Bundle/Application/31AC8A15-C7D8-4116-A4F2-7DA3892609DD/Runner.app/Runner
Reason: tried: '/usr/lib/swift/ObjectBox.framework/ObjectBox' (no such file), '/usr/lib/swift/ObjectBox.framework/ObjectBox' (no such file),
'/private/var/containers/Bundle/Application/31AC8A15-C7D8-4116-A4F2-7DA3892609DD/Runner.app/Frameworks/ObjectBox.framework/ObjectBox'
(mach-o file (/private/var/containers/Bundle/Application/31AC8A15-C7D8-4116-A4F2-7DA3892609DD/Runner.app/Frameworks/ObjectBox.framework/ObjectBox),
but incompatible platform (have 'iOS-sim', need 'iOS')),
As described in the getting-started doc I've set the architecture in XCode to arm64, and that shows up in my flutter project in ios/Runner.xcodeproj/project.pbxproj under buildSettings as:
ARCHS = arm64;
Why does the iOS build of my app crash?