Compiler message:
file:///C:/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/mobx-0.2.0/lib/src/interceptable.dart:11:7: Error: Found unsupported uses of 'T' in supertype 'NotificationHandlers'.
class Interceptors<T>
^
file:///C:/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/mobx-0.2.0/lib/src/listenable.dart:10:7: Error: Found unsupported uses of 'TNotification' in supertype 'NotificationHandlers'.
class Listeners<TNotification>
^
file:///C:/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/mobx-0.2.0/lib/src/core/observable.dart:49:20: Error: The getter 'hasHandlers' isn't defined for the class 'Listeners<ChangeNotification<T>>'.
- 'Listeners' is from 'package:mobx/src/core.dart' ('file:///C:/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/mobx-0.2.0/lib/src/core.dart').
- 'ChangeNotification' is from 'package:mobx/src/core.dart' ('file:///C:/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/mobx-0.2.0/lib/src/core.dart').
Try correcting the name to the name of an existing getter, or defining a getter or field named 'hasHandlers'.
if (_listeners.hasHandlers) {
^^^^^^^^^^^
file:///C:/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/mobx-0.2.0/lib/src/core/observable.dart:63:23: Error: The getter 'hasHandlers' isn't defined for the class 'Interceptors<T>'.
- 'Interceptors' is from 'package:mobx/src/core.dart' ('file:///C:/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/mobx-0.2.0/lib/src/core.dart').
Try correcting the name to the name of an existing getter, or defining a getter or field named 'hasHandlers'.
if (_interceptors.hasHandlers) {
^^^^^^^^^^^
file:///C:/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/mobx-0.2.0/lib/src/interceptable.dart:14:48: Error: Too many positional arguments: 0 allowed, but 1 found.
Try removing the extra positional arguments.
Interceptors(ReactiveContext context) : super(context);
^
file:///C:/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/mobx-0.2.0/lib/src/interceptable.dart:17:52: Error: Method not found: 'add'.
Dispose intercept(Interceptor<T> interceptor) => add(interceptor);
^^^
file:///C:/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/mobx-0.2.0/lib/src/interceptable.dart:17:52: Error: The method 'add' isn't defined for the class 'Interceptors<T>'.
- 'Interceptors' is from 'package:mobx/src/core.dart' ('file:///C:/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/mobx-0.2.0/lib/src/core.dart').
Try correcting the name to the name of an existing method, or defining a method named 'add'.
Dispose intercept(Interceptor<T> interceptor) => add(interceptor);
^^^
file:///C:/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/mobx-0.2.0/lib/src/interceptable.dart:20:10: Error: Method not found: '_canHandle'.
if (!_canHandle(change)) {
^^^^^^^^^^
file:///C:/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/mobx-0.2.0/lib/src/interceptable.dart:26:33: Error: Getter not found: '_handlers'.
for (final interceptor in _handlers.toList(growable: false)) {
^^^^^^^^^
file:///C:/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/mobx-0.2.0/lib/src/interceptable.dart:24:12: Error: Getter not found: '_context'.
return _context.untracked(() {
^^^^^^^^
file:///C:/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/mobx-0.2.0/lib/src/interceptable.dart:20:10: Error: The method '_canHandle' isn't defined for the class 'Interceptors<T>'.
- 'Interceptors' is from 'package:mobx/src/core.dart' ('file:///C:/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/mobx-0.2.0/lib/src/core.dart').
Try correcting the name to the name of an existing method, or defining a method named '_canHandle'.
if (!_canHandle(change)) {
^^^^^^^^^^
file:///C:/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/mobx-0.2.0/lib/src/interceptable.dart:24:12: Error: The getter '_context' isn't defined for the class 'Interceptors<T>'.
- 'Interceptors' is from 'package:mobx/src/core.dart' ('file:///C:/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/mobx-0.2.0/lib/src/core.dart').
Try correcting the name to the name of an existing getter, or defining a getter or field named '_context'.
return _context.untracked(() {
^^^^^^^^
file:///C:/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/mobx-0.2.0/lib/src/interceptable.dart:26:33: Error: The getter '_handlers' isn't defined for the class 'Interceptors<T>'.
- 'Interceptors' is from 'package:mobx/src/core.dart' ('file:///C:/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/mobx-0.2.0/lib/src/core.dart').
Try correcting the name to the name of an existing getter, or defining a getter or field named '_handlers'.
for (final interceptor in _handlers.toList(growable: false)) {
^^^^^^^^^
file:///C:/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/mobx-0.2.0/lib/src/listenable.dart:12:45: Error: Too many positional arguments: 0 allowed, but 1 found.
Try removing the extra positional arguments.
Listeners(ReactiveContext context) : super(context);
^
file:///C:/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/mobx-0.2.0/lib/src/listenable.dart:14:65: Error: Method not found: 'add'.
Dispose registerListener(Listener<TNotification> listener) => add(listener);
^^^
file:///C:/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/mobx-0.2.0/lib/src/listenable.dart:14:65: Error: The method 'add' isn't defined for the class 'Listeners<TNotification>'.
- 'Listeners' is from 'package:mobx/src/core.dart' ('file:///C:/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/mobx-0.2.0/lib/src/core.dart').
Try correcting the name to the name of an existing method, or defining a method named 'add'.
Dispose registerListener(Listener<TNotification> listener) => add(listener);
^^^
file:///C:/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/mobx-0.2.0/lib/src/listenable.dart:17:10: Error: Method not found: '_canHandle'.
if (!_canHandle(change)) {
^^^^^^^^^^
file:///C:/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/mobx-0.2.0/lib/src/listenable.dart:22:30: Error: Getter not found: '_handlers'.
for (final listener in _handlers.toList(growable: false)) {
^^^^^^^^^
file:///C:/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/mobx-0.2.0/lib/src/listenable.dart:21:5: Error: Getter not found: '_context'.
_context.untracked(() {
^^^^^^^^
file:///C:/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/mobx-0.2.0/lib/src/listenable.dart:17:10: Error: The method '_canHandle' isn't defined for the class 'Listeners<TNotification>'.
- 'Listeners' is from 'package:mobx/src/core.dart' ('file:///C:/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/mobx-0.2.0/lib/src/core.dart').
Try correcting the name to the name of an existing method, or defining a method named '_canHandle'.
if (!_canHandle(change)) {
^^^^^^^^^^
file:///C:/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/mobx-0.2.0/lib/src/listenable.dart:21:5: Error: The getter '_context' isn't defined for the class 'Listeners<TNotification>'.
- 'Listeners' is from 'package:mobx/src/core.dart' ('file:///C:/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/mobx-0.2.0/lib/src/core.dart').
Try correcting the name to the name of an existing getter, or defining a getter or field named '_context'.
_context.untracked(() {
^^^^^^^^
file:///C:/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/mobx-0.2.0/lib/src/listenable.dart:22:30: Error: The getter '_handlers' isn't defined for the class 'Listeners<TNotification>'.
- 'Listeners' is from 'package:mobx/src/core.dart' ('file:///C:/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/mobx-0.2.0/lib/src/core.dart').
Try correcting the name to the name of an existing getter, or defining a getter or field named '_handlers'.
for (final listener in _handlers.toList(growable: false)) {
^^^^^^^^^
file:///C:/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/mobx-0.2.0/lib/src/api/observable_collections/observable_list.dart:303:23: Error: The method 'add' isn't defined for the class 'Listeners<ListChange<T>>'.
- 'Listeners' is from 'package:mobx/src/core.dart' ('file:///C:/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/mobx-0.2.0/lib/src/core.dart').
- 'ListChange' is from 'package:mobx/src/api/observable_collections.dart' ('file:///C:/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/mobx-0.2.0/lib/src/api/observable_collections.dart').
Try correcting the name to the name of an existing method, or defining a method named 'add'.
return _listeners.add(listener);
^^^
file:///C:/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/mobx-0.2.0/lib/src/api/observable_collections/observable_map.dart:50:50: Error: The getter 'hasHandlers' isn't defined for the class 'Listeners<MapChange<K, V>>'.
- 'Listeners' is from 'package:mobx/src/core.dart' ('file:///C:/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/mobx-0.2.0/lib/src/core.dart').
- 'MapChange' is from 'package:mobx/src/api/observable_collections.dart' ('file:///C:/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/mobx-0.2.0/lib/src/api/observable_collections.dart').
Try correcting the name to the name of an existing getter, or defining a getter or field named 'hasHandlers'.
_listenersField != null && _listenersField.hasHandlers;
^^^^^^^^^^^
file:///C:/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/mobx-0.2.0/lib/src/api/observable_collections/observable_map.dart:174:32: Error: The method 'add' isn't defined for the class 'Listeners<MapChange<K, V>>'.
- 'Listeners' is from 'package:mobx/src/core.dart' ('file:///C:/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/mobx-0.2.0/lib/src/core.dart').
- 'MapChange' is from 'package:mobx/src/api/observable_collections.dart' ('file:///C:/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/mobx-0.2.0/lib/src/api/observable_collections.dart').
Try correcting the name to the name of an existing method, or defining a method named 'add'.
final dispose = _listeners.add(listener);
^^^
file:///C:/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/mobx-0.2.0/lib/src/api/observable_collections/observable_set.dart:53:50: Error: The getter 'hasHandlers' isn't defined for the class 'Listeners<SetChange<T>>'.
- 'Listeners' is from 'package:mobx/src/core.dart' ('file:///C:/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/mobx-0.2.0/lib/src/core.dart').
- 'SetChange' is from 'package:mobx/src/api/observable_collections.dart' ('file:///C:/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/mobx-0.2.0/lib/src/api/observable_collections.dart').
Try correcting the name to the name of an existing getter, or defining a getter or field named 'hasHandlers'.
_listenersField != null && _listenersField.hasHandlers;
^^^^^^^^^^^
file:///C:/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/mobx-0.2.0/lib/src/api/observable_collections/observable_set.dart:125:32: Error: The method 'add' isn't defined for the class 'Listeners<SetChange<T>>'.
- 'Listeners' is from 'package:mobx/src/core.dart' ('file:///C:/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/mobx-0.2.0/lib/src/core.dart').
- 'SetChange' is from 'package:mobx/src/api/observable_collections.dart' ('file:///C:/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/mobx-0.2.0/lib/src/api/observable_collections.dart').
Try correcting the name to the name of an existing method, or defining a method named 'add'.
final dispose = _listeners.add(listener);
Looks like a dart issue to me. This is failing for generics parsing at the language level. Might be a regression. Thanks for the detailed errors. Will take a look soon.
I am facing the same. Could you please solve it on priority.
Thanking you in advance
@pavanpodila Why it is in need because
Latest Google Play Policy Requires Users to Upload 64-bit Apps
Flutter Stable only Outputs 32-bit binaries
to get 64-bit binaries Users needs to switch to master branch
When switching to master
Every mobx user faces the above problem
I think You understood the problem and its seriousness
That's not a Mobx issue. Other packages have the same problem.
If that is not MobX issue, where we can find dart lang issue so we can track progress of it and maybe increase priority?
From what I see they did change in the way one can declare classes with functions as generic parameters (https://github.com/dart-lang/sdk/commit/76750c58f250901f8b20d0a35303fa9025c7cca3)
And this change broke MobX and maybe other packages.
But if they did that for purpose (and this is not lang regression in that case) MobX and other packages must be fixed to comply with new language rules, I guess.
Oh, maybe you're right then.
But in that case, the fix may not be trivial. It sounds like these requires API changes to fix.
@rrousselGit
Use Flutter Version bounds in your plugin so that new users can make use of new api and also old plugin can work with older version plugins samething happens incase of flutter_svg plugin i was using in my project they updated with new api with version control in pubspec.yaml so that people who uses master repo happy once its released as stable you can merge those braches as your main version
Hum not only on master, I have the same on the beta channel :/
I can confirm that this is indeed a real problem that should be fixed.
I made a similar fix on provider – the issue comes from unsafe use of generics. This unsafe operation is now a compile-time error.
I can confirm that this is indeed a real problem that should be fixed.
I made a similar fix on
provider– the issue comes from unsafe use of generics. This unsafe operation is now a compile-time error.
Is there a place where I can read up more about this, esp. the meaning of unsafe generics ?
Hum not only on master, I have the same on the beta channel :/
@jaumard I think this stems from the fact that changing channel does not change the Dart SDK version. Try running
flutter --version
and you will probably see
Tools • Dart 2.3.2 (build 2.3.2-dev.0.0 e3edfd36b2)
I guess this problem stems from a change in Dart SDK, not in Flutter itself. I am unsure on how you can downgrade Dart SDK.
The only option as of now is to switch to latest compatible flutter+dart, which is v1.6.6. To do so run:
flutter version v1.6.6
@pavanpodila here's the specs of the language change that broke mobx
This should be fixed in this PR: #190
All of the packages have been now published on pub at version 0.2.1
@pavanpodila is PR backward compatible or for new flutter branches only ?
@pavanpodila is PR backward compatible or for new flutter branches only ?
Will work on all channels, so yes its backward compatible.
Most helpful comment
All of the packages have been now published on pub at version 0.2.1