Performans-Dev / per_pkg_seq-logger

BSD 3-Clause "New" or "Revised" License
0 stars 1 forks source link

Unhandled Exception: Bad state: databaseFactory not initialized #1

Open ricardoboss opened 1 year ago

ricardoboss commented 1 year ago

I am getting the following error running seq_logger (version 1.0.6) on Windows:

databaseFactory is only initialized when using sqflite. When using `sqflite_common_ffi`
You must call `databaseFactory = databaseFactoryFfi;` before using global openDatabase API

#0      databaseFactory.<anonymous closure (package:sqflite_common/src/sqflite_database_factory.dart:29:7)
#1      databaseFactory (package:sqflite_common/src/sqflite_database_factory.dart:33:6)
#2      openDatabase (package:sqflite_common/sqflite.dart:83:10)
#3      _LoggerDbProvider.initDb (package:seq_logger/seq_logger.dart:194:18) <asynchronous suspension>
#4      _LoggerDbProvider.database (package:seq_logger/seq_logger.dart:186:17) <asynchronous suspension>
#5      _LoggerDbProvider.getLogs (package:seq_logger/seq_logger.dart:274:16) <asynchronous suspension>
#6      SeqLogger.sendLogs (package:seq_logger/seq_logger.dart:105:16) <asynchronous suspension>
#7      <call from my app>
Flutter doctor ``` [√] Flutter (Channel stable, 3.10.5, on Microsoft Windows [Version 10.0.22621.1926], locale de-DE) • Flutter version 3.10.5 on channel stable at S:\repos\flutter\flutter • Upstream repository https://github.com/flutter/flutter • Framework revision 796c8ef792 (12 days ago), 2023-06-13 15:51:02 -0700 • Engine revision 45f6e00911 • Dart version 3.0.5 • DevTools version 2.23.1 [√] Windows Version (Installed version of Windows is version 10 or higher) [√] Android toolchain - develop for Android devices (Android SDK version 33.0.2) • Android SDK at S:\Android\Sdk • Platform android-33-ext4, build-tools 33.0.2 • ANDROID_HOME = S:\Android\Sdk • Java binary at: C:\Users\\AppData\Local\JetBrains\Toolbox\apps\AndroidStudio\ch-0\222.4459.24.2221.10121639\jbr\bin\java • Java version OpenJDK Runtime Environment (build 17.0.6+0-b2043.56-9586694) • All Android licenses accepted. [√] Chrome - develop for the web • Chrome at C:\Program Files\Google\Chrome\Application\chrome.exe [√] Visual Studio - develop for Windows (Visual Studio Enterprise 2022 17.6.2) • Visual Studio at C:\Program Files\Microsoft Visual Studio\2022\Enterprise • Visual Studio Enterprise 2022 version 17.6.33723.286 • Windows 10 SDK version 10.0.22000.0 [√] Android Studio (version 2022.2) • Android Studio at C:\Users\\AppData\Local\JetBrains\Toolbox\apps\AndroidStudio\ch-0\222.4459.24.2221.10121639 • Flutter plugin version 74.0.2 • Dart plugin version 222.4582 • Java version OpenJDK Runtime Environment (build 17.0.6+0-b2043.56-9586694) [!] Android Studio (version 2023.1) • Android Studio at C:\Users\\AppData\Local\JetBrains\Toolbox\apps\AndroidStudio\ch-1\231.9011.34.2311.10335024 • Flutter plugin version 74.0.4 • Dart plugin version 231.9065 X Unable to find bundled Java version. • Try updating or re-installing Android Studio. [√] VS Code (version 1.79.2) • VS Code at C:\Users\ricar\AppData\Local\Programs\Microsoft VS Code • Flutter extension can be installed from: https://marketplace.visualstudio.com/items?itemName=Dart-Code.flutter [√] Connected device (3 available) • Windows (desktop) • windows • windows-x64 • Microsoft Windows [Version 10.0.22621.1926] • Chrome (web) • chrome • web-javascript • Google Chrome 114.0.5735.134 • Edge (web) • edge • web-javascript • Microsoft Edge 114.0.1823.58 [√] Network resources • All expected network resources are available. ! Doctor found issues in 1 category. ```
ricardoboss commented 1 year ago

I found this: https://github.com/tekartik/sqflite/blob/master/sqflite_common_ffi/doc/using_ffi_instead_of_sqflite.md