6 of 7 SDK package licenses not accepted. 100% Computing updates - flutter

I'm trying to run the command flutter doctor --android-licenses to accept the SDK package license but I'm getting this message
C:\Users\Administrator\AndroidStudioProjects\flutter_app>flutter doctor --android-licenses
6 of 7 SDK package licenses not accepted. 100% Computing updates...
Review licenses that have not been accepted (y/N)?
When I tried to run the application
C:\Users\Administrator\AndroidStudioProjects\flutter_app>flutter run
Launching lib\main.dart on SM J610F in debug mode...
Running Gradle task 'assembleDebug'...
Running Gradle task 'assembleDebug'... Done 61.2s
Exception: Gradle task assembleDebug failed with exit code -1
I tried to run the command in cmd
C:\Users\Administrator\AppData\Local\Android\Sdk\tools\bin>sdkmanager.bat --licenses
but getting below 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 am looking for a solution. Do you have any ideas?
Thanks!

just delete this version and try installing another,
Then verify that you have added the correct path in your Environment Variables

You only have to press 'y' to answer 'yes' to the question and you'll get some screens with the license content that have been not accepted yet. Press 'y' again to accept it and that's all!

When you run "flutter doctor --android-licenses to accept" but donĀ“t receive the option to accept them, run 1) "flutter doctor --android-licenses -v" [ends in -v ] then 2) Run again "flutter doctor --android-licenses to accept" [no -v]
Then you will have a chance to start accept options and just write "y" on all. 3) Run again flutter doctor This worked for me

Related

I get this error i get after upgrading flutter to the latest version

I get this error after upgrading flutter. please how can i fix it.
Launching lib\main.dart on Android SDK built for x86 in debug mode... Exception in thread "main" java.util.zip.ZipException: zip END header not found at java.base/java.util.zip.ZipFile$Source.zerror(ZipFile.java:1607) at java.base/java.util.zip.ZipFile$Source.findEND(ZipFile.java:1497) at java.base/java.util.zip.ZipFile$Source.initCEN(ZipFile.java:1504) at java.base/java.util.zip.ZipFile$Source.(ZipFile.java:1308) at java.base/java.util.zip.ZipFile$Source.get(ZipFile.java:1271) at java.base/java.util.zip.ZipFile$CleanableResource.(ZipFile.java:733) at java.base/java.util.zip.ZipFile$CleanableResource.get(ZipFile.java:850) at java.base/java.util.zip.ZipFile.(ZipFile.java:248) at java.base/java.util.zip.ZipFile.(ZipFile.java:177) at java.base/java.util.zip.ZipFile.(ZipFile.java:191) at org.gradle.wrapper.Install.unzip(Install.java:214) at org.gradle.wrapper.Install.access$600(Install.java:27) at org.gradle.wrapper.Install$1.call(Install.java:74) at org.gradle.wrapper.Install$1.call(Install.java:48) at org.gradle.wrapper.ExclusiveFileAccessManager.access(ExclusiveFileAccessManager.java:65) at org.gradle.wrapper.Install.createDist(Install.java:48) at org.gradle.wrapper.WrapperExecutor.execute(WrapperExecutor.java:128) at org.gradle.wrapper.GradleWrapperMain.main(GradleWrapperMain.java:61) Exception: Gradle task assembleDebug failed with exit code 1 Exited (sigterm)
if you're using Windows, Go to the root directory C:\Users\YourUser and locate the hidden .gradle folder and delete it.
and then run your app connected to an Android emulator or device, don't cancel and make have a stable internet connection, this will download fresh Gradle
If the problem persists, Can you please provide your flutter doctor -v and flutter run --verbose logs, and a minimal complete reproducible code sample

Flutter : Gradle task assembleDebug failed with exit code 1

Launching lib/main.dart on SM A715F in debug mode...Picked up _JAVA_OPTIONS: -Dawt.useSystemAAFontSettings=on -Dswing.aatext=trueException in thread "main" java.net.UnknownHostException: DESKTOP-O8L0ETS 9204at java.base/java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:220)at java.base/java.net.Socket.connect(Socket.java:609)at java.base/java.net.Socket.connect(Socket.java:558)at java.base/sun.net.NetworkClient.doConnect(NetworkClient.java:182)at java.base/sun.net.www.http.HttpClient.openServer(HttpClient.java:474)at java.base/sun.net.www.http.HttpClient$1.run(HttpClient.java:526)at java.base/sun.net.www.http.HttpClient$1.run(HttpClient.java:524)at java.base/java.security.AccessController.doPrivileged(Native Method)at java.base/sun.net.www.http.HttpClient.privilegedOpenServer(HttpClient.java:523)at java.base/sun.net.www.http.HttpClient.openServer(HttpClient.java:564)at java.base/sun.net.www.protocol.https.HttpsClient.<init>(HttpsClient.java:265)at java.base/sun.net.www.protocol.https.HttpsClient.New(HttpsClient.java:372)at java.base/sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.getNewHttpClient(AbstractDelegateHttpsURLConnection.java:212)at java.base/sun.net.www.protocol.http.HttpURLConnection.plainConnect0(HttpURLConnection.java:1208)at java.base/sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:1081)at java.base/sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(AbstractDelegateHttpsURLConnection.java:189)at java.base/sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1592)at java.base/sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1520)at java.base/sun.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream(HttpsURLConnectionImpl.java:250)at org.gradle.wrapper.Download.downloadInternal(Download.java:58)at org.gradle.wrapper.Download.download(Download.java:44)at org.gradle.wrapper.Install$1.call(Install.java:61)at org.gradle.wrapper.Install$1.call(Install.java:48)at org.gradle.wrapper.ExclusiveFileAccessManager.access(ExclusiveFileAccessManager.java:65)at org.gradle.wrapper.Install.createDist(Install.java:48)at org.gradle.wrapper.WrapperExecutor.execute(WrapperExecutor.java:128)at org.gradle.wrapper.GradleWrapperMain.main(GradleWrapperMain.java:61)Exception: Gradle task assembleDebug failed with exit code 1Exited (sigterm)
I am a student.
I am trying to run this app created by flutter but I get this error. I disabled all Java options yesterday thinking that was the problem
I am running on flutter version 2.10.3, dart version 2.16.1.
Try upgrading gradle version and the run "flutter clean" command in terminal and then try to build the project.

Flutter Error in bash after running flutter doctor

When I have run this command
flutter doctor --android-licenses
I got 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)
Do anyone has an idea about this problem , I have googled it and stackoverflowed it but without any result.
Thanks in advance
Make sure you have Installed Flutter properly and updated to latest,
And run
flutter doctor -v
check stats
If that does not work install flutter again,
Check tutorial for help for your Environment

Flutter Project Launch Issue with VsCode

I use my phone as an emulator while developing applications with Flutter.
After updating to the Flutter 2 version, Web Folder added to Flutter file directory, I know that.
but i can't run the project
Here I started the classic flutter counter app and the result:
Launching lib\main.dart on MI 5 in debug mode...
lib\main.dart:1
Exception: Gradle task assembleDebug failed with exit code -1
Exited (sigterm)
I searched for a solution on the internet but could not solve this stupid error
how can i solve this problem?
Connect to Internet
run flutter clean
then flutter pub get
then flutter run .
This might help, try it out.
This error usually comes when some files are pending download or so.
if I use flutter run command from terminal
Launching lib\main.dart on MI 5 in debug mode...
Running Gradle task 'assembleDebug'...
Running Gradle task 'assembleDebug'... Done 76,3s
Exception: Gradle task assembleDebug failed with exit code -1
I'm not sure but,
Try changing minSdkVersion from 16 to 21
You can find this property in ./android/app/build.gradle
Then do a flutter clean and run the project
If this does not work there might be issue with the emulator or the flutter version.

I am using VS Code for Flutter. I have downloaded Android SDK platform 30. But it tells me to download 29 version

I am new to flutter. Here is a list of available tools on SDK Manager -
As you can see I've downloaded the tools. But debugging in the ide shows an error and tells me download a tools that are not installed -
'''
FAILURE: Build failed with an exception.
* What went wrong:
Could not determine the dependencies of task ':app:compileDebugJavaWithJavac'.
> Failed to install the following SDK components:
build-tools;28.0.3 Android SDK Build-Tools 28.0.3
platforms;android-29 Android SDK Platform 29
Install the missing components using the SDK manager in Android Studio.
2
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log
output. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
BUILD FAILED in 51s
[!] Gradle threw an error while downloading artifacts from the network. Retrying to download...
Exception: Gradle task assembleDebug failed with exit code 1
Exited (sigterm)
'''
Please help me out.
There seemed to be errors in installing certain dependencies ( sdk 30 ). Might be a technical glitch. Try installing again using flutter doctor.
I think you have to accept the licenses before building.
Try this command in the terminal
flutter doctor --android-licenses
Try flutter doctor command in your terminal. which helps us diagnose issues with your setup
flutter doctor
to learn more https://stackoverflow.com/a/55641042/7904389
Please share the android/app/build.gradle, it is probably targeting API level 29 (targetSdkVersion 29 and compileSdkVersion 29). Change them to 30 or download the API level 29 SDKs.
If it still doesn't work after that, the SDK might be missing, go to the ANDROID_HOME directory and ensure it contains an sdk directory with the stuff you want.
I couldn't figure out what the error was, but creating a new project worked for me.