My Activity class extends io.flutter.embedding.android.FlutterActivity so that I can override configureFlutterEngine. When I do so and use sqflite, I get following exception
E/flutter (13585): [ERROR:flutter/lib/ui/ui_dart_state.cc(157)] Unhandled Exception: MissingPluginException(No implementation found for method getDatabasesPath on channel com.tekartik.sqflite)
If switch to io.flutter.app.FlutterActivity, I get no exception, but then I cannot use platform channels that I do in configureFlutterEngine.
I also tried registering through ShimPluginRegistry and get exception as well
D/FlutterActivityAndFragmentDelegate(15175): Setting up FlutterEngine.
D/FlutterActivityAndFragmentDelegate(15175): No preferred FlutterEngine was provided. Creating a new FlutterEngine for this FlutterFragment.
W/FlutterEngine(15175): Tried to automatically register plugins with FlutterEngine (io.flutter.embedding.engine.FlutterEngine@fb01f2a) but could not find and invoke the GeneratedPluginRegistrant.
D/FlutterActivityAndFragmentDelegate(15175): Attaching FlutterEngine to the Activity that owns this Fragment.
This is my Activity class
import io.flutter.plugins.GeneratedPluginRegistrant
import io.flutter.embedding.engine.FlutterEngine
import io.flutter.embedding.android.FlutterActivity
import io.flutter.embedding.engine.plugins.shim.ShimPluginRegistry
class MainActivity: FlutterActivity() {
override fun configureFlutterEngine(flutterEngine: FlutterEngine) {
super.configureFlutterEngine(flutterEngine)
GeneratedPluginRegistrant.registerWith(ShimPluginRegistry(flutterEngine))
}
}