Home > Net >  android sdk not found when trying to accept android license without the use of android studio
android sdk not found when trying to accept android license without the use of android studio

Time:12-26

Im trying to learn flutter but i've stumbled uppon issues with the installation, everything worked fine until i ran flutter doctor and it states that i have to accept the android license.

Please keep in mind that i am working without Android Studio so i am looking for a solution that doesnt include a fix that needs android studio

There are many people with the same problems but almost all fixes I have seen include android studio

i installed the commandline-tools seperatly and installed it in my sdk folder, i did this since i dont want to use android studio, but visual studio for the work in flutter.

[√] Flutter (Channel stable, 3.3.10, on Microsoft Windows [Version 10.0.19044.2364], locale de-DE)
[!] Android toolchain - develop for Android devices (Android SDK version 33.0.0)
    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.
[√] Chrome - develop for the web
[√] Visual Studio - develop for Windows (Visual Studio Community 2022 17.1.4)
[!] Android Studio (not installed)
[√] VS Code (version 1.74.2)
[√] Connected device (3 available)
[√] HTTP Host Availability

My Output when i try to accept the licenses:

C:\Users\Tim\AppData\Local\Android\Sdk\cmdline-tools\bin>flutter doctor --android-licenses
Android sdkmanager not found. Update to the latest Android SDK and ensure that the cmdline-tools are installed to resolve this.

I have already trid moving my sdk path via flutter config reinstalling the cmdline-tools updating the path of the cmdline tools looking for updates or newer versions

If someone wants to see all the versions, this is the output when i run flutter doctor -v

C:\Users\Tim\AppData\Local\Android\Sdk\cmdline-tools\bin>flutter doctor -v
[√] Flutter (Channel stable, 3.3.10, on Microsoft Windows [Version 10.0.19044.2364], locale de-DE)
    • Flutter version 3.3.10 on channel stable at C:\Users\Tim\flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 135454af32 (10 days ago), 2022-12-15 07:36:55 -0800
    • Engine revision 3316dd8728
    • Dart version 2.18.6
    • DevTools version 2.15.0

[!] Android toolchain - develop for Android devices (Android SDK version 33.0.0)
    • Android SDK at C:\Users\Tim\AppData\Local\Android\Sdk
    • Platform android-33, build-tools 33.0.0
    • Java binary at: C:\Program Files\Common Files\Oracle\Java\javapath\java.exe
    • Java version Java(TM) SE Runtime Environment (build 18.0.2.1 1-1)
    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.

[√] Chrome - develop for the web
    • Chrome at C:\Program Files\Google\Chrome\Application\chrome.exe

[√] Visual Studio - develop for Windows (Visual Studio Community 2022 17.1.4)
    • Visual Studio at C:\Program Files\Microsoft Visual Studio\2022\Community
    • Visual Studio Community 2022 version 17.1.32407.343
    • Windows 10 SDK version 10.0.19041.0

[!] Android Studio (not installed)
    • Android Studio not found; download from https://developer.android.com/studio/index.html
      (or visit https://flutter.dev/docs/get-started/install/windows#android-setup for detailed instructions).

[√] VS Code (version 1.74.2)
    • VS Code at C:\Users\Tim\AppData\Local\Programs\Microsoft VS Code
    • Flutter extension can be installed from:
       https://marketplace.visualstudio.com/items?itemName=Dart-Code.flutter

[√] Connected device (3 available)
    • Windows (desktop) • windows • windows-x64    • Microsoft Windows [Version 10.0.19044.2364]
    • Chrome (web)      • chrome  • web-javascript • Google Chrome 108.0.5359.125
    • Edge (web)        • edge    • web-javascript • Microsoft Edge 108.0.1462.54

[√] HTTP Host Availability
    • All required HTTP hosts are available

! Doctor found issues in 2 categories.

Keep in mind that one of the issues is that android studio is not installed, but it should work fine without it, so technically there is one issue

Image of my file directory since i am not sure which folders actually belong in there
directory: C:\Users\Tim\AppData\Local\Android\Sdk\cmdline-tools

Is it normal that there is another cmdline tools folder in my cmdline tools folder which holds the latest folder

or should the lastest folder be directly in the cmdline tools

CodePudding user response:

Update your PATH variable in System Environment variable to where sdkmanager is located.

To do this: Go to Windows > Search environment variables> go to "Edit the System Environment Variables"> Create a new variable or add to existing PATH variable as "C:\Users\Tim\AppData\Local\Android\Sdk\cmdline-tools\latest\bin"

Then restart your command prompt and then type flutter doctor --android-licenses

Click y or Yes to accept all policies

Then run flutter doctor -v and check if the issue is resolved

  • Related