Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Android API 35 MissingPluginException #1119

Open
KERRAT opened this issue Jul 31, 2024 · 3 comments
Open

Android API 35 MissingPluginException #1119

KERRAT opened this issue Jul 31, 2024 · 3 comments

Comments

@KERRAT
Copy link

KERRAT commented Jul 31, 2024

When executing the following code with API level 35:

join(await sqlflite.getDatabasesPath(), DATABASE_NAME)

The application encounters the following error and stack trace:

[  +17 ms] E/flutter ( 5012): [ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: MissingPluginException(No implementation found for method getDatabasesPath on channel com.tekartik.sqflite)
[        ] E/flutter ( 5012): #0      MethodChannel._invokeMethod (package:flutter/src/services/platform_channel.dart:332:7)
[        ] E/flutter ( 5012): <asynchronous suspension>
[        ] E/flutter ( 5012): #1      invokeMethod (package:sqflite/src/sqflite_impl.dart:16:5)
[        ] E/flutter ( 5012): <asynchronous suspension>
[        ] E/flutter ( 5012): #2      wrapDatabaseException (package:sqflite/src/exception_impl.dart:7:20)
[        ] E/flutter ( 5012): <asynchronous suspension>
[        ] E/flutter ( 5012): #3      SqfliteDatabaseFactoryMixin.getDatabasesPath (package:sqflite_common/src/factory_mixin.dart:182:20)

However, when running the same code on an API level 34 emulated device, no errors are encountered. There are no differences between the builds used for both tests.

Used sqlflite version is 2.3.3+1.

@alextekartik
Copy link
Contributor

Are you calling this in your main() function or before calling runApp. If so are you calling WidgetsFlutterBinding.ensureInitialized(); before ? Does it work with other plugin (such as path_provider)?

@KERRAT
Copy link
Author

KERRAT commented Aug 1, 2024

@alextekartik , this is called deep after runApp.

WidgetsFlutterBinding.ensureInitialized(); is called right before join(await sqlflite.getDatabasesPath(), DATABASE_NAME), to avoid such errors.

Yes, there is some strange behaviour for Path Provider as well:

[+3966 ms] E/flutter ( 3505): [ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: PlatformException(channel-error, Unable to establish connection on channel., null, null)
[        ] E/flutter ( 3505): #0      PathProviderApi.getApplicationSupportPath (package:path_provider_android/messages.g.dart:65:7)
[        ] E/flutter ( 3505): <asynchronous suspension>
[        ] E/flutter ( 3505): #1      getApplicationSupportDirectory (package:path_provider/path_provider.dart:78:24)
[        ] E/flutter ( 3505): <asynchronous suspension>

Retested on API 34, there are no errors neither for sqlite nor path_provider_android

@alextekartik
Copy link
Contributor

If even path_provider is failing, I won't look at it yet. I try to stick with the compileSdk used my google flutter plugins. I'm not sure sdk 35 is officially supported at this point.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants