"Failed to handle method" Exception When Setting "AllowBackup" option in androidManifest.xml
RafihYahya opened this issue · comments
Version
Technology | Version |
---|---|
Workmanager version | ^0.5.2 |
Flutter 3.19.2 | |
[√] Android toolchain - develop for Android devices (Android SDK version 34.0.0) |
• Android SDK at C:\Users\Administrator\AppData\Local\Android\sdk
• Platform android-34, build-tools 34.0.0
• Java binary at: C:\Program Files\Android\Android Studio\jbr\bin\java
• Java version OpenJDK Runtime Environment (build 17.0.9+0--11185874)
• All Android licenses accepted.
[√] Android Studio (version 2023.2)
• Android Studio at C:\Program Files\Android\Android Studio
• Flutter plugin can be installed from:
https://plugins.jetbrains.com/plugin/9212-flutter
• Dart plugin can be installed from:
https://plugins.jetbrains.com/plugin/6351-dart
• Java version OpenJDK Runtime Environment (build 17.0.9+0--11185874)
**Main Error
When Setting in AndroidManifest.xml, WorkManager refuse to start with an error:
E/MethodChannel#be.tramckrijte.workmanager/foreground_channel_work_manager(17871): Failed to handle method call
E/MethodChannel#be.tramckrijte.workmanager/foreground_channel_work_manager(17871): java.lang.IllegalStateException: WorkManager is not initialized properly. You have explicitly disabled WorkManagerInitializer in your manifest, have not manually called WorkManager#initialize at this point, and your Application does not implement Configuration.Provider.
E/MethodChannel#be.tramckrijte.workmanager/foreground_channel_work_manager(17871): at androidx.work.impl.WorkManagerImpl.getInstance(WorkManagerImpl.java:173)
E/MethodChannel#be.tramckrijte.workmanager/foreground_channel_work_manager(17871): at androidx.work.WorkManager.getInstance(WorkManager.java:184)
E/MethodChannel#be.tramckrijte.workmanager/foreground_channel_work_manager(17871): at dev.fluttercommunity.workmanager.WorkmanagerCallHandlerKt.workManager(WorkmanagerCallHandler.kt:19)
E/MethodChannel#be.tramckrijte.workmanager/foreground_channel_work_manager(17871): at dev.fluttercommunity.workmanager.WorkmanagerCallHandlerKt.access$workManager(WorkmanagerCallHandler.kt:1)
E/MethodChannel#be.tramckrijte.workmanager/foreground_channel_work_manager(17871): at dev.fluttercommunity.workmanager.WM.enqueuePeriodicTask(WorkmanagerCallHandler.kt:253)
E/MethodChannel#be.tramckrijte.workmanager/foreground_channel_work_manager(17871): at dev.fluttercommunity.workmanager.RegisterTaskHandler.enqueuePeriodicTask(WorkmanagerCallHandler.kt:106)
E/MethodChannel#be.tramckrijte.workmanager/foreground_channel_work_manager(17871): at dev.fluttercommunity.workmanager.RegisterTaskHandler.handle(WorkmanagerCallHandler.kt:94)
E/MethodChannel#be.tramckrijte.workmanager/foreground_channel_work_manager(17871): at dev.fluttercommunity.workmanager.WorkmanagerCallHandler.onMethodCall(WorkmanagerCallHandler.kt:34)
E/MethodChannel#be.tramckrijte.workmanager/foreground_channel_work_manager(17871): at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler.onMessage(MethodChannel.java:267)
E/MethodChannel#be.tramckrijte.workmanager/foreground_channel_work_manager(17871): at io.flutter.embedding.engine.dart.DartMessenger.invokeHandler(DartMessenger.java:292)
E/MethodChannel#be.tramckrijte.workmanager/foreground_channel_work_manager(17871): at io.flutter.embedding.engine.dart.DartMessenger.lambda$dispatchMessageToQueue$0$io-flutter-embedding-engine-dart-DartMessenger(DartMessenger.java:319)
However when this option is not included, The workmanager get initialized successfully at startup in debug mode.
*Extra Information
I'm using as target android 9 via USB Debugging.
Any help will be appreciated , and I apologize if I may have broken certain guidelines . My first time reporting a potential bug.