Unable to build flutter tools - flutter

Presently on the master channel, I switched to the beta channel then I run flutter upgrade to find out I can't use Linux as a device, so I switched back to the master branch, I run flutter upgrade. Then I started getting these errors:
Because flutter_tools depends on collection >=1.15.0-nnbd <1.15.0-nullsafety.2
which requires SDK version >=2.9.0-18.0 <=2.9.10, version solving failed.
Error: Unable to 'pub upgrade' flutter tool. Retrying in five seconds... (9 tries left)
The current Dart SDK version is 2.10.0-0.0.dev.flutter-a3815b6590.
Flutter Info before switching to the master channel
Flutter 1.18.0-11.1.pre • channel beta • https://github.com/flutter/flutter.git
Framework • revision 2738a11 (3 months ago) • 2020-05-13 15:24:36 -0700
Engine • revision ef9215ceb2
Tools • Dart 2.9.0 (build 2.9.0-8.2.beta)
I can't presently get any info on the master channel (which I am presently on) cause every time I run any flutter command, it tries to run pub upgrade with keeps giving error.
I am assuming the issue is that Dart SDK
upgraded, if I can roll back to a version compatible with the dependency it should work, or the dependency should be reviewed.

Fixed.
I used git to switched branch to stable, then I run flutter upgrade, it worked fine, but I need to run a Linux app on flutter, so I used git to switch branch to dev, then run flutter upgrade again.

Related

How to use Dart 3 Alpha in a Flutter project?

I've already switch to channel master and running dart --version gives me:
Code Block 1
Dart SDK version: 3.0.0-178.0.dev (dev) (Fri Jan 27 17:53:41 2023 -0800) on "macos_arm64"
However, when I try to use the new syntax for records I get the following:
Code Block 2
This requires the 'records' language feature to be enabled.
Try updating your pubspec.yaml to set the minimum SDK constraint to 3.0.0 or higher, and running 'pub get'.
I tried to change the sdk version value in pubspec to ^3.0.0, but I get this:
Code Block 3
Resolving dependencies...
The current Dart SDK version is 3.0.0-178.0.dev.
Because app requires SDK version 3.0.0, version solving failed. exit code 1
And if I try to set the version to be specifically 3.0.0-178.0.dev then I get the error from code block 2, that is:
This requires the 'records' language feature to be enabled.
Try updating your pubspec.yaml to set the minimum SDK constraint to 3.0.0 or higher, and running 'pub get'.
You can follow these steps.
Step 1: Make sure you are on master branch instead of stable(currently). flutter --version will show something like this or later version
Flutter 3.7.0-29.0.pre.21 • channel master • https://github.com/flutter/flutter.git
Framework • revision 75680ae99e (5 hours ago) • 2023-01-28 08:54:06 -0500
Engine • revision 649362168f
Tools • Dart 3.0.0 (build 3.0.0-179.0.dev) • DevTools 2.20.1
Step 2: config the analyzsis_options.yaml
include: package:flutter_lints/flutter.yaml
analyzer:
enable-experiment:
- records
- patterns
You can check & clone my experimental_project repository.

Failed to release on Testflight

Issue summary:
Try to release Flutter app via Testflight, but failed because Debug mode is contained somewhere in the ipa file.
Detail:
Releasing flutter app as release mode, by below command
flutter build ipa --release --dart-define=ENVIRONMENT=PROD
Then I can see it is passed Validation on Transport App.
However, when I see released app via testflight, attached screen showed.
Though I think this screen appear when Debug mode is contained in ipa file, I'm not sure how and where it's contaminated on my file.
Does anyone know how to solve it?
Config:
flutter --version
Flutter 3.5.0-6.0.pre.37 • channel master •
https://github.com/flutter/flutter.git
Framework • revision 08e1729204 (2 days ago) • 2022-10-13 17:40:07 -0400
Engine • revision 3711bbaeab
Tools • Dart 2.19.0 (build 2.19.0-309.0.dev) • DevTools 2.18.0
Xcode version
Version 13.2.1 (13C100)
Mac version
Monterery
12.4
Apple M1

Why does the error occur after the Flutter Clean command?

After using the Flutter Clean command, packages cannot be found and too many errors appear.
After running the "flutter pub get" command, the problems are corrected.
It wasn't like this before, what could be the reason for this?
Flutter 2.0.2 • channel stable •
Framework • revision 8962f6dc68 (6 days ago) • 2021-03-11 13:22:20 -0800
Engine • revision 5d8bf811b3
Tools • Dart 2.12.1
Flutter clean removes all cached packages which your IDE depends on for code completion. So that is why after running flutter pub get everything goes back to normal as the command re-downloads all the package files the IDE depends on.
Just run flutter pub get after flutter clean Command.
By doing that dependencies on pubspec.yaml file will be updated as well as flutter and dark SDK dependencies.
Why is it like this, a little confused?

is it possible to continue using flutter SDK "1.20.0" and not upgrading anymore? any future problems can arise from that behavior?

every time i get a notification to upgrade to newer flutter SDK and i do the upgrade...my project gets broken...due to incompatibility of packages with each others...i tried to install the packages again one by one...also tried to manipulate the packages version...i tried to migrate to different flutter channels like master, dev, beta..going back to stable...but no luck :(
and i end up in downgrading the flutter SDK to "1.20.0" again...i did that everytime till the newest version of flutter SDK "1.22.4 1aafb3a 13/11/2020"
once i downgrade to "1.20.0"..everything goes fine...
for example...one of the errors am facing right now using the flutter SDK "1.22.4"..when i flutter pub get..i get this:
Because every version of flutter_common_exports depends on flutter_localizations any from sdk which depends on collection 1.15.0-nullsafety.3, every version of flutter_common_exports requires collection 1.15.0-nullsafety.3.
And because dartx >=0.2.0 <0.5.0 depends on collection >=1.14.11 <1.15.0, flutter_common_exports is incompatible with dartx >=0.2.0 <0.5.0.
So, because myApp depends on flutter_common_exports any which depends on dartx ^0.4.1, version solving failed.
pub get failed (1; So, because myApp depends on flutter_common_exports any which depends on dartx ^0.4.1, version solving failed.)
exit code 1
am using:
Flutter 1.22.4 • channel stable • https://github.com/flutter/flutter.git
Framework • revision 1aafb3a8b9 (28 hours ago) • 2020-11-13 09:59:28 -0800
Engine • revision 2c956a31c0
Tools • Dart 2.10.4
so what will happen if i didn't follow any upgrade notifications and continue developing my app using flutter SDK "1.20.0" till i release my app to the store ?!
is there any consequences that will happen?!
thanks in advance
In short, you can’t use the latest SDK on this project yet, not while the packages you’re using don’t get updated and are compatible with the latest SDK.
You can use the old SDK, you're just missing out on new features.
If you work with a team, you should start declaring the compatible SDK on your “pubspec.yaml” file, so that everyone knows which SDK version it was tested for:
version: 1.0.0+1
environment:
sdk: ">=2.2.2 <3.0.0"
flutter: "1.9.1+hotfix.6"

Anyone experience vscode very slow after update to 1.30?

What settings to disable to make it fast again?
I'm using VSCode for flutter development. Now very slow when starting the app and during hot reload. Now almost impossible to perform hot reload. I must stop it, do changes then start rather than waiting on hot reload process.
Before update, it was fast but sometimes crash.
I only use Dart 2.21.1 and Flutter 2.21.1 extension. And running on Windows 10.
=======================================================================
The issue seems gone away.
Now I'm using VS Code 1.31.1
flutter --version
Flutter 1.1.8 • channel beta • https://github.com/flutter/flutter.git
Framework • revision 985ccb6d14 (8 weeks ago) • 2019-01-08 13:45:55 -0800
Engine • revision 7112b72cc2
Tools • Dart 2.1.1 (build 2.1.1-dev.0.1 ec86471ccc)
And Dart/Flutter extension is 2.24.0
In your folder, run
flutter clean
this will delete all flutter dependencies and then re-create the project again by using
flutter create YourProjectName
this will create all the flutter dependencies again in your current project, you will not loose your files
The issue seems gone away.
Now I'm using VS Code 1.31.1
flutter --version
Flutter 1.1.8 • channel beta • https://github.com/flutter/flutter.git
Framework • revision 985ccb6d14 (8 weeks ago) • 2019-01-08 13:45:55 -0800
Engine • revision 7112b72cc2
Tools • Dart 2.1.1 (build 2.1.1-dev.0.1 ec86471ccc)
And Dart/Flutter extension is 2.24.0