Error when I tried to run flutter doctor --android-licenses - flutter

I'm new to flutter, I installed it on my Ubuntu,
on running flutter doctor I got error
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.
So I tried
flutter doctor flutter doctor --android-licenses, which gave me this error
*Error occurred during initialization of boot layer
java.lang.module.FindException: Module java.se.ee not found
*
someone please let me know what I should do. I tried downgrading jdk'11 to jdk'8 didnt work

After few minutes of finding whats happening with licenses, I rebooted my system after downgrading the jdk and It worked.
Sometimes we just need to reboot :)

Related

Why it shows parameter not correct on flutter? [duplicate]

I am new to Flutter and today I've been stuck to one problem. I cannot debug my app because it says parameter format not correct
Parameter format not correct -
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:packageDebug'.
> Several variant outputs are configured to use the same file name "resources-debug.ap_", filters : MAIN:MAIN
Here's my flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[√] Flutter (Channel stable, v1.17.5, on Microsoft Windows [Version 10.0.18362.900], locale en-US)
[!] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
! Some Android licenses not accepted. To resolve this, run: flutter doctor --android-licenses
[!] Android Studio (version 3.4)
X Flutter plugin not installed; this adds Flutter specific functionality.
X Dart plugin not installed; this adds Dart specific functionality.
[√] VS Code (version 1.46.1)
[!] Connected device
! No devices available
! Doctor found issues in 3 categories.
I've looked for answers everywhere and they didn't work for my case. Most of the solutions are suggesting to change environment path. This is my path: C:\src\flutter\bin
note: I'm using VSCode
Please help.. thank you!
As I observe your Flutter Doctor, it's already defined that Android toolchain and the Android Studioandroid studio is not configured. So. follow the below steps.
For resolve Android toolchain run the "flutter doctor --android-licenses". And for "Android Studio" resolve please goto Android Studio -> Files -> Settings -> Plugins -> install the Flutter. While installing flutter its also asked for install dart click ok and after installation, it will ask to restart the Android Studio. After restart goes to Flutter terminal and runs Flutter Doctor, Now you have resolved the above issue. The last issue is just ignored because it's just showing that no devices are connected.
And you can run the Flutter in Android Studio in Windows and Mac.
This error occurred because of the app level Gradle.file minSdkVersion property is less than 20 or the targetSdkVersion property is less than 30.
It may work for you. In my case, it works perfectly.
minSdkVersion : 20
targetSdkVersion : 30
run these in your project folder,
flutter channel stable
flutter upgrade --force
flutter pub cache repair
flutter clean
Now try to run

Flutter Doctor - Android toolchain (Missing)

I ran a fresh installation of the latest version of Flutter and then ran flutter doctor. Everything is fine but I always get this error (this is why I am reinstalling flutter):-
[!] Android toolchain - develop for Android devices (Android SDK version 31.0.0)
X cmdline-tools component is missing
Run `path/to/sdkmanager --install "cmdline-tools;latest"`
See https://developer.android.com/studio/command-line for more details.
X Android license status unknown.
Run `flutter doctor --android-licenses` to accept the SDK licenses.
See https://flutter.dev/docs/get-started/install/windows#android-setup for more details.
I have tried several fix like going to this website -> https://www.programsbuzz.com/article/set-android-environment-variable-path-windows-10 but nothing works. PLease help me.
You can either run flutter doctor --android-licenses and it will install the command line tools or if it is giving an error regarding the path of sdkmanager then you can install Android Studio and install command line tools directly from there.
Go to SDK Manager > Android SDK > Check on Android SDK Command-Line Tools
Then click on apply and it will install all the required dependencies.
Run flutter doctor to check if everything is installed successfully or not.
Go to your Terminal and Simply Run :
flutter doctor --android-licenses
It will solve this issue .

vs code cannot launch android emulator

i was just starting with flutter and i was using android studio before and i have an emulator but now i wanted to start with flutter and tried to run the default flutter project but says no device and when i try to connect to the emulator i have it just keeps loading and says "Failed to launch Pixel 3a API 29: Error: Emulator didn't connect within 60 seconds"
tried a lot to fix it but still the same error.
and by the way when i run flutter doctorit displays
Doctor summary (to see all details, run flutter doctor -v):
1.[✓] Flutter (Channel stable, 2.0.2, on Linux, locale en_US.UTF-8)
2.[!] Android toolchain - develop for Android devices (Android SDK version 29.0.2)
✗ 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.
3.[✗] Chrome - develop for the web (Cannot find Chrome executable at google-chrome)
! Cannot find Chrome. Try setting CHROME_EXECUTABLE to a Chrome executable.
4.[✓] Android Studio (version 3.5)
5.[!] Connected device
! No devices available
! Doctor found issues in 3 categories.
thanks in advance.
I have faced this problem before, Try these steps:
Open your android studio, go to avd manager
Now select your emulator, click on dropdown in actions and wipe data
Check whether you have intel x86 emulator accelerator ticked in sdk tools in android studio.
If the problem still persists, you can remove this emulator and install a new one.

Flutter and Dart plugin not installed errror when downgrade flutter even though they are installed on android studio

Doctor summary (to see all details, run flutter doctor -v):
[√] Flutter (Channel unknown, v1.4.0, on Microsoft Windows [Version 10.0.19041.804], locale en-IE)
[!] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
X Android license status unknown.
Try re-installing or updating your Android SDK Manager.
See https://developer.android.com/studio/#downloads or visit
https://flutter.io/setup/#android-setup for detailed
instructions.
[!] Android Studio
X Flutter plugin not installed; this adds Flutter specific functionality.
X Dart plugin not installed; this adds Dart specific functionality.
[√] VS Code (version 1.52.1)
[!] Connected device
! No devices available
I was using the latest version of flutter, ran flutter doctor, everything was fine. I then downgraded flutter now it's saying I don't have the flutter and Dart pluggins installed even though I do.
I ran this command - flutter doctor --android-licenses and received the following error
A newer version of the Android SDK is required. To update, run: C:\Users\willm\AppData\Local\Android\sdk\tools\bin\sdkmanager --update
I then ran the command it told me to run and received this error
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:602)
at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:522)
... 5 more
I have now ran out of ideas, any advice on what to do without upgrading flutter again?
There are some solutions that maybe helpful
1). Solution 1
Run Flutter clean ann rebuild the app
2). Solution 2
Accept Licenses by running following commands
You just have to accept license by running this command
yes | sdkmanager --licenses
for Linux Use:
yes | ~/Android/Sdk/tools/bin/sdkmanager --licenses
for Windows Use:
%ANDROID_HOME%/tools/bin/sdkmanager --licenses
Note: set
%ANDROID_HOME%
as
C:\Users\username\AppData\Local\Android\Sdk
After that check licenses
Flutter:
flutter doctor --android-licenses
3).Solution 3
the current SDK version is incompatible with Java 9.
So, to solve it, you can downgrade your java version to Java 8, or with a workaround, you can export the following option on your terminal:
Linux:
export JAVA_OPTS='-XX:+IgnoreUnrecognizedVMOptions --add-modules java.se.ee'
Windows:
set JAVA_OPTS='-XX:+IgnoreUnrecognizedVMOptions --add-modules java.se.ee'
And to make it stick, you can export the JAVA_OPTS in your profile file on Linux (.zshrc, .bashrc and etc.) or add as an environment permanently on Windows.
Then, you can type the flutter or sdkmanager command:
Flutter:
flutter doctor --android-licenses
sdkmanager:
sdkmanager --licenses
and type Y when needed to accept the licenses.
so i was experiencing the same issue after upgrading to flutter 2.0, but some packages aren't ready. because of that i had to downgrade. Even though flutter doctor said:
[!] Android Studio (version 4.1.0)
X Flutter plugin not installed; this adds Flutter specific functionality.
X Dart plugin not installed; this adds Dart specific functionality.
I was still able to build and test app without issues. So try rebuilding and running app. hopefully when it's save to upgrade to 2.0 these little things will go.

flutter: parameter format not correct

I am new to Flutter and today I've been stuck to one problem. I cannot debug my app because it says parameter format not correct
Parameter format not correct -
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:packageDebug'.
> Several variant outputs are configured to use the same file name "resources-debug.ap_", filters : MAIN:MAIN
Here's my flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[√] Flutter (Channel stable, v1.17.5, on Microsoft Windows [Version 10.0.18362.900], locale en-US)
[!] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
! Some Android licenses not accepted. To resolve this, run: flutter doctor --android-licenses
[!] Android Studio (version 3.4)
X Flutter plugin not installed; this adds Flutter specific functionality.
X Dart plugin not installed; this adds Dart specific functionality.
[√] VS Code (version 1.46.1)
[!] Connected device
! No devices available
! Doctor found issues in 3 categories.
I've looked for answers everywhere and they didn't work for my case. Most of the solutions are suggesting to change environment path. This is my path: C:\src\flutter\bin
note: I'm using VSCode
Please help.. thank you!
As I observe your Flutter Doctor, it's already defined that Android toolchain and the Android Studioandroid studio is not configured. So. follow the below steps.
For resolve Android toolchain run the "flutter doctor --android-licenses". And for "Android Studio" resolve please goto Android Studio -> Files -> Settings -> Plugins -> install the Flutter. While installing flutter its also asked for install dart click ok and after installation, it will ask to restart the Android Studio. After restart goes to Flutter terminal and runs Flutter Doctor, Now you have resolved the above issue. The last issue is just ignored because it's just showing that no devices are connected.
And you can run the Flutter in Android Studio in Windows and Mac.
This error occurred because of the app level Gradle.file minSdkVersion property is less than 20 or the targetSdkVersion property is less than 30.
It may work for you. In my case, it works perfectly.
minSdkVersion : 20
targetSdkVersion : 30
run these in your project folder,
flutter channel stable
flutter upgrade --force
flutter pub cache repair
flutter clean
Now try to run