Time and again I encountered this error in flutter ever confused on how to solve it:
compiler message: lib/splash_screen.dart:69:28: Error: A value of type '#lib1::RiteKey' can't be assigned to a variable of type '#lib2::RiteKey'. compiler message: Try changing the type of the left hand side, or casting the right hand side to '#lib2::RiteKey'. compiler message: riteKey: riteKey, compiler message: ^ Error -32000 received from application: There are no running service protocol handlers.
This #lib1:Object #lib2:Object error was quite frustrating because there wasn’t much we were doing wrong…
I don’t know the details but this was finally solved 2 days ago on Stack Overflow(pseudo heaven for devs who get stuck)
Flutter: A value of type lib1::Object can't be assigned to a variable of type lib2::Object
While trying to compile this code: import 'package:flutter/material.dart'; import…
well read the discussion and you see that the team is already on it!
This is the issue to track:
Recognize file entry-points that should be accessed as package URIs · Issue #33076 · dart-lang/sdk
Users provide entry points to our tools as command line arguments. In some cases those entry points are inside a the…
So what do we need to do?
->Don’t use relative paths to import files in main.dart
Use absolute paths starting from the package name itself. Like:
And that’s it! Wishing that all your code compiles and runs well,
Raveesh Signing off!
(BTW Flutter+Gotcha = Flotcha!!)