Closed OrlandoEduardo101 closed 4 years ago
I'm having the same problem. I was following the problem reported in this issue: https://github.com/flutter/flutter/issues/56779#issuecomment-666540672 but that was closed without my case in specific being solved, so I think I must continue here.
More information can be found in the original issue that I linked, but to summarize, I'm trying to run flutter pub run build_runner build
in my Flutter project, but that is failing with a message asking to file an issue here.
Here is my setup:
I solved it by switching the channel to Dev.
Thanks for filing an issue. Analyzer 0.39.15 is available for language version 2.10.0. https://pub.dev/packages/analyzer/changelog
Obrigado por registrar um problema. O analisador 0.39.15 está disponível para a versão 2.10.0 do idioma. https://pub.dev/packages/analyzer/changelog
Because build_runner 1.10.1 depends on analyzer 0.39.14 and no versions of build_runner match >1.10.1 <2.0.0, build_runner ^1.10.1 requires analyzer 0.39.14.
the build runner is't compatible with analyzer 0.39.15
You now need the latest analyzer 0.39.15 😢 , so the fix for flutter stable breaks the latest flutter by not allowing the latest analyzer.
This situation is really unfortunate in general... we can release a new version of build_runner which removes the pinning and sets a min sdk constraint of 2.10 to solve the problem I think.
cc @leafpetersen @scheglov @natebosch @stereotype441
Note that in the meantime the fix is to pin either analyzer to 0.39.15 or build_runner to 1.10.1
This issue cannot be resolved in the way I suggested due to https://github.com/dart-lang/pub/issues/2557, I would not be able to publish the package
I switch dart to dev channel, conforme the friend said above, its working.
I believe that we have unblocked the fix for this from landing, and @natebosch has landed the fix from @jakemac53 .
How do we get this to work with Flutter?
If I require the SDK version 2.10.0 (which is the dev channel of dart), I get the error:
Running "flutter pub get" in my_app...
The current Dart SDK version is 2.9.0-21.0.dev.flutter-20bf2fcf56.
Because the app depends on build_runner >=1.10.2 which requires SDK version >=2.10.0-0.0 <3.0.0, version solving failed.
pub get failed (1; Because the app depends on build_runner >=1.10.2 which requires SDK version >=2.10.0-0.0 <3.0.0, version solving failed.)
This is on the dev branch of Flutter.
The workaround seems to be switching to the flutter master branch: flutter channel master
, but I'd prefer not to be there.
Any help?
hii I am having the exact same problem
How do we get this to work with Flutter?
If I require the SDK version 2.10.0 (which is the dev channel of dart!!), I get the error:
Running "flutter pub get" in my_app... The current Dart SDK version is 2.9.0-21.0.dev.flutter-20bf2fcf56. Because the app depends on build_runner >=1.10.2 which requires SDK version >=2.10.0-0.0 <3.0.0, version solving failed. pub get failed (1; Because the app depends on build_runner >=1.10.2 which requires SDK version >=2.10.0-0.0 <3.0.0, version solving failed.)
This is on the dev branch of Flutter.
The workaround seems to be switching to the flutter master branch:
flutter channel master
, but I'd prefer not to be there.Any help?
@vaibhav135 This was the solution for us:
dev_dependencies:
build_runner: 1.10.1
dependency_overrides:
analyzer: 0.39.14
Allows us to run the unstable versions of flutter, but the stable version of dart.
edit Suggest doing what jakemac53 suggests in the post below, if that works for you.
You should be able to use a ^
constraint on build_runner now like build_runner: ^1.10.0
to get the right version for your sdk.
why it is closed ? I have this issue with beta channel.
@mohammadne can you clarify what issue you are having? What does your pubspec.yaml
look like, what error are you seeing, and with which exact version of the Flutter SDK?
Hello, we don't have the option to use unstable branches since we're using production apps; what would the solution be then? Keep in mind we have over 31 applications with hundreds of packages. Currently build_runner
is broken with Flutter 1.20.4 and updating the dart versions breaks a lot of packages. Why does builder_runner really need to use the latest?
@ollydixon can you share some more details? What does the pubspec look like, which fails to resolve with flutter 1.20.4 ?
analyzer 0.39.17
and build_runner 1.10.0
appear to work with flutter 1.20.4.
There has been some sort of tool or something proliferating I think which adds constraints like ^<latest-version>
to pubspecs, which has lead to a lot of confusion around this.
This worked for me:
I had the same problem with Flutter 1.22.0 and Dart 2.10.0. Today updated my pubspec.yaml to
build_runner:
And deleted
dependency_overrides:
analyzer: 0.39.14
Then flutter packages upgrade in console to force analyzer upgrade. It's working now.
For me the fix was upgrading analyzer: '0.39.15'
I am using sdk: ">=2.10.0 <3.0.0"
I solved it by switching the channel to Dev.
How?
This worked for me:
I had the same problem with Flutter 1.22.0 and Dart 2.10.0. Today updated my pubspec.yaml to
build_runner:
And deleted
dependency_overrides: analyzer: 0.39.14
Then flutter packages upgrade in console to force analyzer upgrade. It's working now.
Keep in mind that this will break a lot of libraries.
Thank you for taking the time to file an issue!
This tracker is for issues related to:
Some other pieces of the Dart ecosystem are maintained elsewhere. Please file issues in their repository:
If you aren't sure, file the issue here and we'll find the right home for it. In your issue, please include:
dart --version
)Missing some or all of the above might make the issue take longer or be impossible to act on.
If you simply have a question, consider starting with Stack Overflow:
https://stackoverflow.com/questions/tagged/dart
For a real-time response, consider our Gitter channel:
https://gitter.im/dart-lang/sdk