Howdy!
I'm developing an analyzer plugin for the first time, so I may be missing a glaringly obvious thing I'm doing wrong, but I've had the plugin working until a few days ago. I started developing it about a week ago but, recently, I've been getting an Exception in the Plugin section of the Analysis Server Diagnostics page:
Exception: Expected isCompatible at result
#0 new PluginVersionCheckResult.fromJson (package:analyzer_plugin/protocol/protocol_generated.dart:3526:9)
#1 new PluginVersionCheckResult.fromResponse (package:analyzer_plugin/protocol/protocol_generated.dart:3562:37)
#2 PluginSession.start (package:analysis_server/src/plugin/plugin_manager.dart:987:43)
#3 PluginInfo.start (package:analysis_server/src/plugin/plugin_manager.dart:219:21)
#4 PluginManager.addPluginToContextRoot (package:analysis_server/src/plugin/plugin_manager.dart:344:23)
What's interesting is that, while using the proxy server debugging method described
here, I no longer have problems in that section, but I do get exceptions in the Exceptions section when the plugin sends notifications (so, the server no longer crashes on version check, I think):
Exception type '_Map<String, dynamic>' is not a subtype of type 'Map<String, Object>' in type cast
Socket error: type '_Map<String, dynamic>' is not a subtype of type 'Map<String, Object>' in type castfatal: false
#0 new Notification.fromJson (package:analyzer_plugin/protocol/protocol.dart:43:35)
#1 ServerIsolateChannel.listen.<anonymous closure> (package:analyzer_plugin/src/channel/isolate_channel.dart:234:39)
#2 _rootRunUnary (dart:async/zone.dart:1414:13)
#3 _CustomZone.runUnary (dart:async/zone.dart:1307:19)
#4 _CustomZone.runUnaryGuarded (dart:async/zone.dart:1216:7)
#5 _BufferingStreamSubscription._sendData (dart:async/stream_impl.dart:339:11)
#6 _BufferingStreamSubscription._add (dart:async/stream_impl.dart:271:7)
#7 _SyncStreamControllerDispatch._sendData (dart:async/stream_controller.dart:774:19)
#8 _StreamController._add (dart:async/stream_controller.dart:648:7)
#9 _StreamController.add (dart:async/stream_controller.dart:596:5)
#10 _RawReceivePort._handleMessage (dart:isolate-patch/isolate_patch.dart:192:26)
Going back to the scenario where I don't use the proxy server debugging method, when looking at package:analyzer_plugin/protocol/protocol_generated.dart in my .pub-cache, I see that PluginVersionCheckResult.fromJson is not on line 3526 (like the isCompatible exception says), but on line 3669, which leads me to believe that there are breaking inconsistencies between the analysis_plugin package bundled with the Dart SDK and what pub pulls into my plugin package.
I'm working with a Flutter global installation through
fvm by using
Sidekick. Currently on Flutter stable 3.7.7 with Dart 2.19.4.
1. Any ideas how I should carry on?
2. Has this message been too long?
I've attached some .yaml files for my setup, in case they're of any help. The Flutter testing app depends on
my_analyzer_plugin. The plugin contains the bootstrap package, as specified
here. What differs in my case is that the plugin package is merged into the host package.
Thanks a bunch!