Open marcojr opened 3 years ago
@pavanpodila I believe this was caused by https://github.com/mobxjs/mobx.dart/pull/689. The current stable release (currently 2.2.3) of Flutter depends on a specific version of meta
, which is 1.3.0. analyzer
2.x requires meta
1.7.0+. This means anyone currently on the stable channel cannot use the latest versions of MobX. From what I can see, the solutions for someone looking to use MobX are
mobx_codegen
used. That is instead of specifying mobx_codegen: ^2.0.3
in the pubspec.yaml, specify mobx_codegen: 2.0.2
. dev
or master
Perhaps the aforementioned PR should be reverted so that mobx_codegen
can republished to resolve the issue and then go into a 3.0.0 (pre)release. 2.0.2 is the last working version of mobx_codegen that works on the stable channel and one typically wouldn't expect that bumping the patch version would lead to a broken build, which can happen automatically due to use of the caret syntax. I noticed I wasn't able to build the code in mobx_examples
due to this issue as well. Perhaps the build pipeline could also be updated so one of the checks it runs is build the code in mobx_examples
as this would've helped catch the issue. The author of the PR also mentioned running into issues with doing this here
I could manage to continue my work by adding:
dependency_overrides: meta: 1.7.0
on the pubspec. I will keep my temp workaround here just in case someone get stuck on it and need some help.
Thanks @MaikuB for the analysis. I think your suggestion about pinning the mobx_codegen version to 2.0.2
is an acceptable solution for now. We will need to add more checks to our pipeline to catch this. Building the mobx_examples is a stop gate. Any ideas how we can do this on Github Actions ?
Afraid not as I haven't used GitHub actions at all as I'm using Cirrus CI for my other plugins at the moment. Adding this step would most likely cause it to fail on when trying to build on stable though due to the same issue reported in this thread
I just create a blank project with intention to create a sample project to demo how mobx works. So, everything that I am using is the latest version and there is just mobx related libs installed. However I am receiving:
Because mobx_codegen >=2.0.3 depends on analyzer ^2.0.0 which depends on meta ^1.7.0, mobx_codegen >=2.0.3 requires meta ^1.7.0.
And because every version of flutter from sdk depends on meta 1.3.0, mobx_codegen >=2.0.3 is incompatible with flutter from sdk. So, because mobxflutter depends on both flutter any from sdk and mobx_codegen ^2.0.3, version solving failed. pub get failed (1; So, because mobxflutter depends on both flutter any from sdk and mobx_codegen ^2.0.3, version solving failed.) exit code 1
This is my pubspec: