I've been trying to setup flutter with android studio on my laptop (Windows 11), and as I tried to agree to the android licenses the below error occured :
The first error in red says
'(C:\Users\jerry\AppData\Local\Android\Sdk\cmdline-tools\latest\bin\sdkmanager.bat): "ProcessException: Cannot find file specified'
Apologies for the Japanese.
Below are the SDK Platforms installed :
Solutions attempted :
- Installing 'Android SDK Command-line tools (latest)' and 'Android SDK Tools (Obsolete)' as suggested by this thread : Android SDK Tools option is missing from SDK Manager in Android Studio 3.6.1
- Reinstalling Android studio
- Updating the sdkmanager
- Checking PATH variables (JAVA_HOME in the System Variables set to C:\Program Files\Java\jdk1.8.0_351)
- Running the command myself, which has allowed me to agree to the licenses, however the issue persists with the android licenses when flutter doctor is run.
I've tried my best at scouring the internet for solutions, but any help would be much appreciated. I have made another question for the
" 'git rev-parse HEAD' is not recognized as an internal or external command"
error here : " 'git rev-parse HEAD ' is not recognized" error when flutter doctor, but still works normally? I'm not sure if the two issues are connected, but if someone can also assist me on that issue I'd be extremely grateful.
Flutter doctor was posing the same licensing issue on Windows 10, even after I took the nifty cue here to manually run "sdkmanager.bat --licenses". The issue resolved when I set the recommended environment variables from SDK tools documentation. Flutter doctor reported some licenses were not accepted, but running "flutter doctor --android-licenses" took care of it.
Caveat, somewhat related: flutter doctor still chokes for two other issues:
The workaround typically offered for this issue has been to copy the contents of C:\Program Files\Android\Android Studio\jbr into the C:\Program Files\Android\Android Studio\jre directory; alternatively to update the JAVA_HOME environment variable path to the jbr directory. This didn't work this time. I had to take the suggestion flutter doctor offered:
Hope I don't need that, but flutter doctor thereafter reported favorably "No issues found!" All green checks. Finally.