Closed joshmark-novade closed 3 years ago
@joshmark-novade Glad to hear the package is being useful to you!
Have you configured your project with the following instructions?
https://github.com/davidmartos96/sqflite_sqlcipher/blob/master/sqflite/README.md#android
Also, it would be great to know in what platform are you getting the error. Android or iOS? Edit: I've noticed that you mentioned APK in the title.
Hey @davidmartos96 yeah, we did the setup just like your readme says. Also, it works on debug and profile modes.
@joshmark-novade Is by any chance your project somewhat "old"? It may have something to do with the new Android plugin embedding API. Could you try the example project in the repository? It's under "sqflite/example" I have just tried it and it works fine in release mode with Flutter 1.22
https://github.com/flutter/flutter/wiki/Upgrading-pre-1.12-Android-projects
@joshmark-novade Here is a relevant thread on the topic, but with normal sqflite
https://stackoverflow.com/questions/62890116/missingpluginexceptionno-implementation-found-for-method-getdatabasespath-on-c
@joshmark-novade Were you able to get it working?
Hey @davidmartos96 still working on it. The SqflitePlugin is registered as part of the GeneratedPluginRegistrant, so I don't think the solution from that link is valid here.
I'll try downgrading to Flutter v1.22, lets see if that helps.
Hey @davidmartos96 unfortunately, this looks like a problem on every version from 1.22 to 1.26. I've confirmed that the setup is as instructed, and the plugin is registered. Not sure what the next step should be, as it persists as an issue specifically on release versions of our Android app.
@joshmark-novade That's odd. The release version on Android ka working fine for me on the example project inside the repo and on my app using Flutter 1.22 Could you try the example project? You could also try recloning your project on a different folder and see if it has something to do with some temporary build file.
Hey @davidmartos96 still working on it. The SqflitePlugin is registered as part of the GeneratedPluginRegistrant, so I don't think the solution from that link is valid here.
I'll try downgrading to Flutter v1.22, lets see if that helps.
Here you mention that SqflitePlugin
is registered but this plugin is called SqfliteSqlcipherPlugin
. Was this a typo? Sqflite plugin may be registered still if you use other dependencies that use it under the hood, like cache_network_image
.
In any case you should look into the new way in which the plugins get registered with the app. Take a look at this migration guide: https://github.com/flutter/flutter/wiki/Upgrading-pre-1.12-Android-projects
Apologies for that @davidmartos96, that was indeed a typo. However, I can confirm that both SqflitePlugin and SqfliteSqlCipherPlugin are registered as part of the GeneratedPluginRegistrant as shown below.
public final class GeneratedPluginRegistrant {
public static void registerWith(@NonNull FlutterEngine flutterEngine) {
ShimPluginRegistry shimPluginRegistry = new ShimPluginRegistry(flutterEngine);
flutterEngine.getPlugins().add(new io.flutter.plugins.camera.CameraPlugin());
flutterEngine.getPlugins().add(new io.flutter.plugins.connectivity.ConnectivityPlugin());
flutterEngine.getPlugins().add(new io.flutter.plugins.deviceinfo.DeviceInfoPlugin());
flutterEngine.getPlugins().add(new com.jrai.flutter_keyboard_visibility.FlutterKeyboardVisibilityPlugin());
flutterEngine.getPlugins().add(new io.flutter.plugins.flutter_plugin_android_lifecycle.FlutterAndroidLifecyclePlugin());
flutterEngine.getPlugins().add(new com.it_nomads.fluttersecurestorage.FlutterSecureStoragePlugin());
flutterEngine.getPlugins().add(new vn.hunghd.flutter.plugins.imagecropper.ImageCropperPlugin());
flutterEngine.getPlugins().add(new io.flutter.plugins.imagepicker.ImagePickerPlugin());
flutterEngine.getPlugins().add(new com.vitanov.multiimagepicker.MultiImagePickerPlugin());
io.scer.pdf.renderer.NativePdfRendererPlugin.registerWith(shimPluginRegistry.registrarFor("io.scer.pdf.renderer.NativePdfRendererPlugin"));
flutterEngine.getPlugins().add(new com.crazecoder.openfile.OpenFilePlugin());
flutterEngine.getPlugins().add(new io.flutter.plugins.pathprovider.PathProviderPlugin());
flutterEngine.getPlugins().add(new com.tekartik.sqflite.SqflitePlugin());
flutterEngine.getPlugins().add(new com.davidmartos96.sqflite_sqlcipher.SqfliteSqlCipherPlugin());
flutterEngine.getPlugins().add(new eu.simonbinder.sqlite3_flutter_libs.Sqlite3FlutterLibsPlugin());
flutterEngine.getPlugins().add(new name.avioli.unilinks.UniLinksPlugin());
}
}
Hey @davidmartos96, looks like I found a fix that worked for me.
Following the steps described in this article did the trick! (https://stackoverflow.com/questions/63766058/flutter-issues-with-release-mode-only-apk-builds)
But seriously man, thanks so much for being so helpful with this! You freaking rule!
@joshmark-novade Awesome! Happy to hear that you got it working.
Hello!
First off, big ups on this package, its great!
However, I've been experiencing an issue while attempting to run a release apk of my app. Specifically release, both profile and debug seem to be OK.
I'm getting the foll. error:
Any fixes for this would be much appreciated. Also, if I can provide additional details on my end, please let me know.