Skip to content

Failed to load dynamic library (dlopen failed: library libsqlite3.so not found) #505

Description

@alexobviously

I've got a flutter app using both sqflite_ffi, with a script that works fine when I run it as pure dart but crashes with this error when I trigger it as part of the flutter app:

I/flutter (18313): [SqfliteFfiException(error, Invalid argument(s): Failed to load dynamic library (dlopen failed: library "/data/data/com.twoplayerchess/lib/libsqlite3.so" not found)} DatabaseException(Invalid argument(s): Failed to load dynamic library (dlopen failed: library "/data/data/com.twoplayerchess/lib/libsqlite3.so" not found)) {}, #0      SqfliteIsolate.handle (package:sqflite_common_ffi/src/isolate.dart:39:9)
I/flutter (18313): <asynchronous suspension>
I/flutter (18313): #1      FfiMethodCallHandler._isolateHandle (package:sqflite_common_ffi/src/database_factory_ffi.dart:54:27)
I/flutter (18313): #2      FfiMethodCallHandler.handleInIsolate (package:sqflite_common_ffi/src/database_factory_ffi.dart:33:26)
I/flutter (18313): #3      databaseFactoryFfiImpl.<anonymous closure> (package:sqflite_common_ffi/src/database_factory_ffi.dart:17:25)
I/flutter (18313): #4      _SqfliteDatabaseFactoryImpl.invokeMethod (package:sqflite_common/src/mixin/factory.dart:20:27)
I/flutter (18313): #5      SqfliteDatabaseMixin.invokeMethod (package:sqflite_common/src/database_mixin.dart:287:15)
I/flutter (18313): #6      SqfliteDatabaseMixin.saf

Flutter doctor -v

[✓] Flutter (Channel stable, 1.20.2, on Mac OS X 10.14.6 18G2022, locale en-GB)
    • Flutter version 1.20.2 at /Users/alex/Developer/flutter
    • Framework revision bbfbf1770c (4 weeks ago), 2020-08-13 08:33:09 -0700
    • Engine revision 9d5b21729f
    • Dart version 2.9.1

 
[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.3)
    • Android SDK at /Users/alex/Library/Android/sdk
    • Platform android-29, build-tools 29.0.3
    • Java binary at: /Applications/Android
      Studio.app/Contents/jre/jdk/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build
      1.8.0_242-release-1644-b3-6222593)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 11.3.1)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Xcode 11.3.1, Build version 11C504
    • CocoaPods version 1.9.1

[✓] Android Studio (version 4.0)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin version 48.0.2
    • Dart plugin version 193.7361
    • Java version OpenJDK Runtime Environment (build
      1.8.0_242-release-1644-b3-6222593)

[!] IntelliJ IDEA Community Edition (version 2020.1)
    • IntelliJ at /Applications/IntelliJ IDEA CE.app
    ✗ Flutter plugin not installed; this adds Flutter specific functionality.
    ✗ Dart plugin not installed; this adds Dart specific functionality.
    • For information about installing plugins, see
      https://flutter.dev/intellij-setup/#installing-the-plugins

[✓] VS Code (version 1.48.2)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.14.1

[✓] Connected device (1 available)
    • Android SDK built for x86 (mobile) • emulator-5554 • android-x86 • Android 10
      (API 29) (emulator)

! Doctor found issues in 1 category.

I'm also using the standard sqflite plugin as part of this app for something totally separate. Don't know if that affects anything but that part is running fine. I'm only using sqflite_ffi for this part because it needs to run outside flutter sometimes too and sqflite doesn't support that. I'm not doing anything special when it crashes, just opening a static asset database.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions