Flutter app not compiling after upgrading - flutter

output of flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 2.2.2, on Linux, locale en_GB.UTF-8)
[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.2)
[✓] Chrome - develop for the web
[✓] Android Studio (version 4.1)
[✓] VS Code (version 1.56.2)
[✓] Connected device (2 available)
• No issues found!
After i did dart pub upgrade ...i got the following..
output of --stacktrace

I was getting the same error and I tried
flutter clean
and then
dart pub upgrade
for the Dependencies upgrade.
and then it started working you can just click on the Pub Upgrade in Android studio in pubspec.yml file of your projects.
Or you can remove the dependency which is creating issue after upgarde.

Related

Flutter launcher icons fails because --sound-null-safety missing

I am trying to create icons for my app using flutter_launcher_icons, with options defined in pubspec.yaml. When I run flutter pub run flutter_launcher_icons:main, I get the following error:
Unable to spawn isolate: error: Library 'file:///Users/cameron/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_launcher_icons-0.9.0/bin/main.dart' was compiled with sound null safety (in strong mode) and it requires --sound-null-safety option at runtime
pub finished with exit code 1
Even if I pass in --sound-null-safety, the error persists (I also tried '--no-sound-null-safety' which also did nothing).
To check it wasn't a configuration error, I ran flutter create <name>, added flutter_launcher_icons: to dev dependencies (and flutter pub get), ran the same command and got the same error.
I am on Flutter 2.2, and I depend on integration_test, so I can't downgrade to a pre-null-safety version of flutter_launcher_icons, because those versions have transitive dependencies that conflict with integration_test from sdk.
Flutter doctor:
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 2.2.2, on macOS 11.4 20F71 darwin-x64, locale en-GB)
[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
[✓] Xcode - develop for iOS and macOS
[✓] Chrome - develop for the web
[✓] Android Studio (version 4.1)
[✓] IntelliJ IDEA Ultimate Edition (version 2020.3.4)
[✓] VS Code (version 1.57.1)
[✓] Connected device (2 available)
• No issues found!

Having trouble installing Flutter

I was trying to install Flutter on my VS Code but I kept running into this issue. Android license status unknown.
(base) Lenovo-Legion:~/Documents/$ flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 2.0.6, on Linux, locale en_GB.UTF-8)
[!] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
✗ Android license status unknown.
Run `flutter doctor --android-licenses` to accept the SDK licenses.
See https://flutter.dev/docs/get-started/install/linux#android-setup for more details.
[✓] Chrome - develop for the web
[✓] Android Studio
[✓] VS Code (version 1.55.2)
[✓] Connected device (1 available)
! Doctor found issues in 1 category.
(base) Lenovo-Legion:~/Documents/$ flutter doctor --android-licenses
Exception in thread "main" java.lang.NoClassDefFoundError: javax/xml/bind/annotation/XmlSchema
at com.android.repository.api.SchemaModule$SchemaModuleVersion.<init>(SchemaModule.java:156)
at com.android.repository.api.SchemaModule.<init>(SchemaModule.java:75)
at com.android.sdklib.repository.AndroidSdkHandler.<clinit>(AndroidSdkHandler.java:81)
at com.android.sdklib.tool.sdkmanager.SdkManagerCli.main(SdkManagerCli.java:73)
at com.android.sdklib.tool.sdkmanager.SdkManagerCli.main(SdkManagerCli.java:48)
Caused by: java.lang.ClassNotFoundException: javax.xml.bind.annotation.XmlSchema
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:581)
at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:522)
... 5 more
(base) Lenovo-Legion:~/Documents/$
I went back to Android Studio and updated all the SDK licenses as well. No help. How can I fix it?
This was fixed by going to Android studio> Settings > Appearance & Behavior > System Settings > Android SDK > SDK Tools and checking the option to download the Android SDK Command-line Tools (latest).
Android SDK Command Line Tools
Then reboot VS Code and re-run flutter doctor --android-licenses and enter y to accept all licenses. Should work like a charm now!
(base) Lenovo-Legion:~/Documents/$ flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 2.0.6, on Linux, locale en_GB.UTF-8)
[!] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
! Some Android licenses not accepted. To resolve this, run: flutter doctor --android-licenses
[✓] Chrome - develop for the web
[✓] Android Studio
[✓] VS Code (version 1.55.2)
[✓] Connected device (1 available)
! Doctor found issues in 1 category.
(base) Lenovo-Legion:~/Documents/$ flutter doctor --android-licenses
5 of 6 SDK package licenses not accepted. 100% Computing updates...
Review licenses that have not been accepted (y/N)? y
1/5: License android-googletv-license:
---------------------------------------
Terms and Conditions
This is the Google TV Add-on for the Android Software Development Kit License Agreement.
......
......
......
......
Check
(base) Lenovo-Legion:~/Documents/$ flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 2.0.6, on Linux, locale en_GB.UTF-8)
[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
[✓] Chrome - develop for the web
[✓] Android Studio
[✓] VS Code (version 1.55.2)
[✓] Connected device (1 available)
• No issues found!

Failed to launch DevTools: TimeoutException after 0:00:10.000000: Future not completed

The flutter tools aren't launching when I press the button on Android Studio, and I also get a warning when I use flutter run.
I've tried flutter clean, but this still happens on both the terminal and Android Studio flutter plugin.
flutter doctor output:
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 2.0.2, on macOS 11.2.3 20D91 darwin-x64, locale
en-GB)
[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
[✓] Xcode - develop for iOS and macOS
[✓] Chrome - develop for the web
[✓] Android Studio (version 4.1)
[✓] Android Studio
[✓] VS Code (version 1.54.3)
[✓] Connected device (2 available)
• No issues found!
Does anyone have suggestions on how to fix this?
Rebooting my computer fixed it.

Everything is install but in Android Studio Flutter and Dart Error

I installed everything but when I run flutter doctor then this error occurs.
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel beta, v0.5.1, on Linux, locale en_US.UTF-8)
[✓] Android toolchain - develop for Android devices (Android SDK 28.0.2)
[✓] Android Studio (version 3.1)
✗ Flutter plugin not installed; this adds Flutter specific functionality.
✗ Dart plugin not installed; this adds Dart specific functionality.
[!] Connected devices
! No devices available
! Doctor found issues in 2 categories.
you can ignore those errors if you are going to use vscode as your IDE.
The answer to this error is:
flutter channel dev
flutter upgrade
flutter config --android-studio-dir="C:\Program Files\Android\Android Studio"
flutter doctor -v
when I run these 4 commands then this error will automatically solve.

Could not open android app with release with Flutter beta 1.25.0-8.1.pre

I've recently updated Flutter to 1.25.0-8.1.pre in beta. I could run debug apk and build release. But, the release-apk doesn't work and it stuck on default splash screen. Where the problem lies in. Is there any such bug from Flutter?
flutter doctor:
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel beta, 1.25.0-8.1.pre, on Linux, locale en_US.UTF-8)
[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
[✓] Chrome - develop for the web
[✓] Android Studio
[✓] IntelliJ IDEA Community Edition (version 2020.3)
[✓] VS Code (version 1.52.1)
[✓] Connected device (3 available)
• No issues found!
I just downgrade the flutter version to 1.24.0-10.2.pre which released on 11/19/2020 and retried building release apk. And it worked fine. Actually the problem lies with Flutter new update on beta. The corresponding issue : https://github.com/flutter/flutter/issues/72705