I've been using a handful of flutter plugins recently. Many worked perfectly, but I stumbled across frustrating errors several times, generally resulting in giving up the plugins.
Here is the last one I got, with schedule_notifications :
E/flutter (24758): [ERROR:topaz/lib/tonic/logging/dart_error.cc(16)] Unhandled exception:
E/flutter (24758): MissingPluginException(No implementation found for method getIconResourceId on channel schedule_notifications_app)
E/flutter (24758): #0 MethodChannel.invokeMethod (package:flutter/src/services/platform_channel.dart:278:7)
E/flutter (24758): <asynchronous suspension>
E/flutter (24758): #1 _MyAppState._getIconResourceId (<my path>/sandbox/lib/main.dart:67:40)
E/flutter (24758): <asynchronous suspension>
E/flutter (24758): #2 _MyAppState.initState (<my path>/sandbox/lib/main.dart:24:7)
E/flutter (24758): #3 StatefulElement._firstBuild (package:flutter/src/widgets/framework.dart:3751:58)
E/flutter (24758): #4 ComponentElement.mount (package:flutter/src/widgets/framework.dart:3617:5)
E/flutter (24758): #5 Element.inflateWidget (package:flutter/src/widgets/framework.dart:2907:14)
E/flutter (24758): #6 Element.updateChild (package:flutter/src/widgets/framework.dart:2710:12)
E/flutter (24758): #7 RenderObjectToWidgetElement._rebuild (package:flutter/src/widgets/binding.dart:857:16)
E/flutter (24758): #8 RenderObjectToWidgetElement.mount (package:flutter/src/widgets/binding.dart:828:5)
E/flutter (24758): #9 RenderObjectToWidgetAdapter.attachToRenderTree.<anonymous closure> (package:flutter/src/widgets/binding.dart:774:17)
E/flutter (24758): #10 BuildOwner.buildScope (package:flutter/src/widgets/framework.dart:2222:19)
E/flutter (24758): #11 RenderObjectToWidgetAdapter.attachToRenderTree (package:flutter/src/widgets/binding.dart:773:13)
E/flutter (24758): #12 _WidgetsFlutterBinding&BindingBase&GestureBinding&ServicesBinding&SchedulerBinding&PaintingBinding&RendererBinding&WidgetsBinding.attachRootWidget (package:flutter/src/widgets/binding.dart:662:7)
E/flutter (24758): #13 runApp (package:flutter/src/widgets/binding.dart:704:7)
E/flutter (24758): #14 main (<my path>/sandbox/lib/main.dart:8:16)
E/flutter (24758): #15 _startIsolate.<anonymous closure> (dart:isolate/runtime/libisolate_patch.dart:279:19)
E/flutter (24758): #16 _RawReceivePortImpl._handleMessage (dart:isolate/runtime/libisolate_patch.dart:165:12)
D/libGLESv2(24758): DTS_GLAPI : DTS is not allowed for Package : <my package>
D/libGLESv1(24758): DTS_GLAPI : DTS is not allowed for Package : <my package>
D/ViewRootImpl(24758): ViewPostImeInputStage processPointer 0
D/ViewRootImpl(24758): ViewPostImeInputStage processPointer 1
There are many examples of similar questions on SO and GitHub (see the end of my post), but the only thing ever suggested to fix them is "use flutter clean
, flutter upgrade
, flutter packages get
and then flutter run
". Sometimes it may be enough, but not always - in my particular case, I still get the exact same error.
Noticeably, if I clone the whole GitHub repository of the plugin and run the example from within this directory, it does work well. But if I try to re-create the example project, it does not, so I take it I'm missing something, but what ?
Here are the steps I followed to re-create the example :
Create a new Flutter project in Android Studio
Add the dependency
schedule_notifications: ^0.1.8 in pubspec.yaml
Click on the Flutter commands
Packages get
andPackages upgrade
in Android StudioClick on the popup
Get packages
in Android Studio when it appearedPaste the code from https://github.com/serralvo/schedule_notifications/blob/master/example/lib/main.dart in my
main.dart
fileChange the line
import 'package:schedule_notifications_example/time_picker.dart';
intoimport 'time_picker.dart';
to resolve the error I got from Android StudioCreate a file
time_picker.dart
next tomain.dart
and paste in it the code from https://github.com/serralvo/schedule_notifications/blob/master/example/lib/time_picker.dartExecute the project in Android Studio and get the aforementioned error
Launch the Flutter console and go in the directory of my project
Execute the commands
flutter clean
,flutter upgrade
,flutter packages get
in the consoleExecute the command
flutter run
in the console and still get the same error
So, what is going on exactly ? What could produce this behavior with some plugins, for some developers or some projects ? What am I doing wrong ?
Examples of similar questions :