Android licenses is toggling between not found and not accepted - android

Im starting with flutter. I have the flutter sdk setup. When I run flutter doctor sometimes it shows
Android Licenses are not accepted and other times it shows Android licenses are not accepted. Can someone tell me why flutter is gaving this weird behavior.
Another thing is when I run flutter doctor --android-licenses it wont wait for my to input y, otherwise it doestn't show anything
I have
- Sdk 29,28,27,26 platform
- Obsolete Sdk tool package
- Commandline tools
- emulator
- sdk platform tools
I think it should work with the obsolete sdk tools.
But I have no idea why it is acting weird.

It worked when I reset my windows.
Its not a perfect solution but hope it will help someone.

I think reinstalling Android Studio after clearning its cache and all other files will help

Related

Flutter's doctor and sdkmanager are working against each other

Problem:
I am currently installing Flutter and flutter doctor tells me that I have to accept the SDK licenses with flutter doctor --android-licenses. That command in turn tells me (or to be exact it calls <sdk>/cmdline-tools/latest/sdkmanager and sdkmanager in turn tells me) that it could not determine the SDK root and that I should call it (it being the sdkmanager) with --sdk_root= or move this package into its expected location: <sdk>/cmdline-tools/latest.
I have no idea what latter "this package" refers to, but if I run the former sdkmanager with --sdk_root=<sdk>, I can accept all 7 licenses it gives me. So everything should work, right? No. If I run flutter doctor again, it still tells me to accept the SDK licenses. So flutter thinks the licenses are not accepted while the sdkmanager now tells me that all licenses are accepted. What is going on?
Context (for those who need it):
I'm using a newly setup MacBook with Android Studio Electric Eel (ASEE) freshly installed. For some reason there was no /cmdline-tools/ in <sdk> (for me /Users/<my_user_name>/Library/Android/sdk), even though officially it should come with ASEE, so I had to download it manually and put it in <sdk>. That download in turn was also missing many folders. For example the command-line tools documentation tells me that the sdkmanager is in <sdk>/cmdline-tools/<version>/bin/, but it isn't. It's just in /cmdline-tools/bin/. So I found out what the correct version is, made a symbolic link from <version>/bin to /bin, then flutter tells me that it also needs /latest/bin/, so I do the same for latest. And that's where I am right now.

Cannot accept SDK Licenses for android SDK in Flutter

This is my first time running Flutter as I am looking to get started with it. When I try to configure it my apps cant be run because SDK Licenses have not been accepted. When I try to fix that in the suggested way I get the following error :
Exception Gets Thrown When I Try To Accept Licenses
How do I fix this exception?
I've fixed a similar issue by deleting the build tools from the Android SDK folder and reinstall it again.

tns doctor, need the Android SDK Build-tools installed (Windows 10)

Regards
I am following the coursera course, but I am getting an error on: tns doctor
I have seen several posts on stackoverflow, but I have not found a solution.
I already checked my system variables:
I add my sdk in Android Studio
Please I need help, since I want to continue advancing but I don't know what else to do
Thank you very much in advance
I found the answer, you have to install that version in sdk tools

Android SDK Tools option is missing from SDK Manager in Android Studio 3.6.1

On a freshly installed macOS Catalina, I installed Android Studio 3.6.1.
I've got the following error when I ran flutter doctor in the course of setting up flutter SDK on my Mac.
[!] Android toolchain - develop for Android devices (Android SDK version 29.0.3)
✗ Android license status unknown.
Try re-installing or updating your Android SDK Manager.
See https://developer.android.com/studio/#downloads or visit
https://flutter.dev/setup/#android-setup for detailed instructions.
I re-installed Android Studio and follow the instructions in the second link in the error message, but these links do not seem to help resolving the issue. I also tried the following:
$ flutter doctor --android-licenses
Which gives the following error:
Android sdkmanager tool not found
(/Users/username/Library/Android/sdk/tools/bin/sdkmanager).
Try re-installing or updating your Android SDK,
visit https://flutter.dev/setup/#android-setup for detailed instructions.
I checked my installation and found out that tools directory is missing under ~/Library/Android/sdk/.
Also, I found out Android SDK Tools option is missing from SDK Tools tab in SDK Manager of the Android Studio as shown in this screenshot. (Android SDK Tools option was present on my previous installation of Android Studio 3.5.3.)
Has anyone had the similar problem? I am not sure what I'm doing wrong. If anyone can show me how I can fix this issue, I'd appreciate it! (This is my first question on Stack Overflow. Please excuse me for lengthy post.)
I'm using Linux but I guess the problem might be the same.
Launch Android Studio and go to "SDK Manager" - you can launch it after creating a blank project and going "Tools -> SDK Manager" under the "AVD Manager" option. In the new window open "System Settings -> Android SDK". From there pick "SDK Tools". Now you need to uncheck the "Hide Obsolete Packages" option in the bottom of the window. Now there should appear a new option: "Android SDK Tools (Obsolete)" - check that, hit "Apply" - it will download the files and "Tools" folder will appear in the Android folder. Then simply run "flutter doctor" in the terminal and you should be asked to accept some licenses - simply run:
$ flutter doctor --android-licenses
It helped me. I don't know why this option went obsolete when Flutter requires it anyway. Check the settings printscreen.
Step1. Download latest sdk tools from https://androidsdkmanager.azurewebsites.net/SDKTools.
up to 2020-03-08 the latest version is 26.2.0.
Step2. Unzip and then copy "tools" folder into android-sdk folder. "tools" and "build-tools" is in the same depth.
Step3. flutter doctor --android-licenses
Step4. flutter doctor
Open the Android Studio SDK Manager
In the Android SDK tab, uncheck Hide Obsolete Packages
Check Android SDK Tools (Obsolete) Check and download it!
I had a similar problem with Android Studio 3.6.1 (not involving flutter): the platform-tools directory got installed within another platform-tools directory, so Android Studio couldn't find adb, and so couldn't communicate with my phone. A completely fresh re-install of Android Studio didn't even help. I ended up manually moving the platform-tools one directory up and that fixed it:
% cd ~/Library/Android/sdk
% mv platform-tools platform-tools-bad
% mv platform-tools-bad/platform-tools .

Nativescript on windows7 `tns platform add android` can't find the right Android SDK

i was looking for answer to this question and found this Cannot find a compatible Android SDK for compilation when running `tns platform add android`
But none of the answers helped me, it still throws error.
Here is what i'm doing:
Installed chocolatey
installed everything like in tutorial
Cloned sample project and so on
Trying to "tns platform add android" and got
Cannot find a compatible Android SDK for compilation. To be able to build for Android, install Android SDK 22 or later.
My setup is Windows7 x32, and it's my first time to try nativescript (which looks really powerful at the sample video), and i'm really interested in it, can someone help me with this problem?
Did you install the sdk platform & tools ? If not run android from the command prompt the sdk manager should open then you can install the tools required (Android SDK Tools, Android SDK Platform-tools & Android SDK Build-tools). After try running tns platform add android again ..:)
Looks like i've found answer to my own question again.
I looked at Set Up Windows guide and at the line Install the required Android SDKs and the Local Maven repository for Support Libraries. with code echo yes | "%ANDROID_HOME%\tools\android" update sdk --filter tools,platform-tools,android-23,build-tools-23.0.2,extra-android-m2repository,extra-google-m2repository,extra-android-support --all --no-ui
bug appeared here, nothing actually installed nor updated, i should get everything at right from the | in that code and run it in cmd, answering y on all questions. That helped, but thanks for all answers, it made me look one more time at docs.

Categories

Resources