Error when using sqflite_common_ffi instead of sqfilte on Android - flutter

For targeting mulitple platforms, I want to use sqflite_common_ffi instead of sqflite (sqflite_common_ffi is compatible with Windows).
But when I run my project on Android, I have this exception when runningdatabaseFactoryFfi.openDatabase method:
Invalid argument(s): Failed to load dynamic library '/data/data/com.coutier.scool/lib/libsqlite3.so': dlopen failed: library "/data/data/com.coutier.scool/lib/libsqlite3.so" not found
I do not understand : sqlite not supposed to be included in android ? Why this package want to load a specific library ?
If I really need this library to make sqflite_common_ffi run, where can I find this library and where have I to put in my project tree ?

On iOS and Android, you can add sqlite3_flutter_libs that includes the binaries for iOS and Android. sqflite_common_ffi uses sqlite3 and its default library loader should work as is.

Related

I am having error just after restarting computer in flutter Error: A file can't be part of more than one library

I am having this problem since restart and i think due to auto-update package but now i am having this error. This happens when i run my code and stop before executing anything.
Launching lib\main.dart on Edge in debug mode...
/C:/src/flutter_windows_2.10.4-stable/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_core-2.3.0/lib/src/firebase_app.dart: Error: A file can't be part of more than one library.
Try moving the shared declarations into the libraries, or into a new library.
/C:/src/flutter_windows_2.10.4-stable/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_core-2.3.0/lib/firebase_core.dart: Context: Used as a part in this library.
/C:/src/flutter_windows_2.10.4-stable/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_core-2.3.0/lib/firebase_core.dart%20: Context: Used as a part in this library.
/C:/src/flutter_windows_2.10.4-stable/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_core-2.3.0/lib/src/firebase.dart: Error: A file can't be part of more than one library.
Try moving the shared declarations into the libraries, or into a new library.
/C:/src/flutter_windows_2.10.4-stable/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_core-2.3.0/lib/firebase_core.dart: Context: Used as a part in this library.
/C:/src/flutter_windows_2.10.4-stable/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_core-2.3.0/lib/firebase_core.dart%20: Context: Used as a part in this library.
Failed to compile application.
Exited (sigterm)
I have tried pub get, Flutter clean, flutter upgrade downgrade. Help me to resolve this error.

Netbeans 13 installing native library error

I'm trying to install netbeans and the following error appears:
Cannot load native library which is strictly necessary to work correctly. Exception: org.netbeans.installer.utils.exceptions.NativeException: Cannot load native library from path: native/jnilib/windows/windows-x64.dll
I've already added the JAVA_HOME variable and it's showing the path in the prompt:

Flutter_Unity_Widget: Failure to initialize, Your hardware does not support this application

I'm trying to develop an entire screen in a flutter project using unity with Flutter_Unity_Widget.
I've followed the package installation instructions at pub.dev "https://pub.dev/packages/flutter_unity_widget"
but when I run the applications it pops up a window with some errors:
screenshot for emulator after running
E/Unity ( 5165): Failed to load 'libmain.so'
E/Unity ( 5165):
E/Unity ( 5165): java.lang.UnsatisfiedLinkError: dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/com.example.flutter_unity_app-H-CtYDrgxEULJH5uT-8PqQ==/base.apk"],nativeLibraryDirectories=[/data/app/com.example.flutter_unity_app-H-CtYDrgxEULJH5uT-8PqQ==/lib/x86, /data/app/com.example.flutter_unity_app-H-CtYDrgxEULJH5uT-8PqQ==/base.apk!/lib/x86, /system/lib]]] couldn't find "libmain.so"
E/Unity ( 5165): Your hardware does not support this application.
and I can't handle this error.
versions:
unity: 2021.1.4f1
flutter_unity_widget: ^4.1.0
enulator: Nexus 6 API 28 android pie 9
Unity with emulator is usually painful way to develop. Try to find a real device. Because you have to export your unity as library correctly. First install to your device, then export as library. Do you have same errors with real device? Even you successfully install to your device, there is a warning with the widget you use.
Note: Supports only Unity 2019.4.3 or later. UnityFramework does not support emulator.

How to use cloud_firestore in flutter for web and android?

I have a Flutter app which works on Android as expected but if I want to compile it for Web I get an error.
It has to do something with the dependency cloud_firestore. If I use the dependency firebase it works fine on the web but on android now not..
This is the error message I get using cloud_firestore (compiling for web):
Skipping compiling pay_balance|lib/main_web_entrypoint.dart with ddc because some of its
transitive libraries have sdk dependencies that not supported on this platform:
firebase_core|lib/firebase_core.dart
https://github.com/dart-lang/build/blob/master/docs/faq.md#how-can-i-resolve-skipped-compiling-warnings
Can anybody help me? Maybe with another dependency for firestore (I did not find others which are working on web and android)..
Edit: I have used the firebase-dart plugin for web!! -> Only works on the web but not in android for me -> I need something for both at the same time!!
Or is there a Way I can use both packages without getting a compling error for the web when I import cloud_firestore?
If you want to use Firebase on Web and Mobile you have to get creative. I created the fb_auth plugin that uses the Mobile SDK firebase_auth on iOS and Android and the firebase package on web. This will give you a single plugin for auth.
https://pub.dev/packages/fb_auth
Im working on firstore and storage but they are not ready yet.
I have also created an article on how to do this with flutter:
https://medium.com/#rody.davis.jr/how-to-build-a-native-cross-platform-project-with-flutter-372b9e4b504f
You have to use dynamic imports so that at compile time it tree shakes what it doesn't need and will not throw an error.
Currently this is the only way to officially use both plugins in the same project.
EDIT: cloud_firestore now added
Two of the FutterFire plugins are now supported for web. FlutterFire plugins supporting web firebase_auth and firebase_core
cloud_firestore is now also supported

Android App Bundle - native code library failed to load

I need to replace the APK to App Bundle feature.
My app using some SDK with native libraries.
The app build.gradle dependencies countains:
     implementation files ('libs / refsi.jar')
     implementation files ('libs / tsi.jar')
The SDK native libraries (two .so files for each architecture) placed under /app/src/main/jniLibs/ (armeabi-v7a | arm64-v8a | x86 | x86_64 | armeabi)
I tried to use googles instructions, and I was looking for help, but after I download the app from google play to my test device, the SDK was not working - the log file shows that the files not found.
"...Native code library failed to load. dalvik.system.PathClassLoader[DexPathList[
[zip file "/data/app/ ....
Please help me understand the correct and simple way to use an app bundle in that case.
This might help you, according to google doc
When building an Android App Bundle, APKs generated from that app bundle that target Android 6.0 (API level 23) or higher now include uncompressed versions of your native libraries by default. This optimization avoids the need for the device to make a copy of the library and thus reduces the on-disk size of your app. If you'd rather disable this optimization, add the following to your gradle.properties file:
android.bundle.enableUncompressedNativeLibs = false