Home:ALL Converter>Objectbox Flutter - iOS app crashes on startup

Objectbox Flutter - iOS app crashes on startup

Ask Time:2022-01-08T14:28:05         Author:adrian

Json Formatter

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?

Author:adrian,eproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/70630102/objectbox-flutter-ios-app-crashes-on-startup
yy