0

We are trying to accept the android SDK licenses for the flutter using the flutter doctor --android-licenses command to accept all the licenses automatically in the CI systems for automation purposes. So, we tried some of the online suggestions and every one-liner command approach for accepting the licenses automatically didn't work. Here's some of the commands we tried at our end.

echo y | flutter doctor --android-licenses enter image description here

yes | flutter doctor --android-licenses - this didn't work (reported yes not recognized')

"yes" | flutter doctor --android-licenses - this didn't work (reported "yes not recognized')

y | flutter doctor --android-licenses - this didn't work

"y" | flutter doctor --android-licenses - this didn't work

echo yes 'y' | flutter doctor --android-licenses enter image description here

The information on the android studio and the android SDK versions are as follows. enter image description here enter image description here

Is there any other command line approaches that can be used to accept the android SDK licenses without have to manually press 'y' to accept them?

srk_sync
  • 339
  • 1
  • 4
  • Have you tried `echo y | flutter doctor --android-licenses` – Just a Person Oct 20 '22 at 04:03
  • Yes, I tried that command, but it's not accepting the licenses and ends the command saying that > 7 of 7 SDK package licenses not accepted. 100% Computing updates... Review licenses that have not been accepted (y/N)? Terminate batch job (Y/N)? – srk_sync Oct 20 '22 at 04:08
  • What about this: `cmd.exe /C"%ANDROID_HOME%\tools\bin\sdkmanager.bat --licenses"`. But ANDROID_HOME should be added to your path – Just a Person Oct 20 '22 at 04:11
  • I have tried this, and it still asks for manual review and accept the licenses. `sdkmanager.bat --licenses 7 of 7 SDK package licenses not accepted. 100% Computing updates... Review licenses that have not been accepted (y/N)?`. But I need a command that can manually accept the licenses all at once. – srk_sync Oct 20 '22 at 04:36
  • @srk_sync Please try this solution hope it will work for you. https://stackoverflow.com/a/67480249/12187270 – Nitin Gadhiya Oct 20 '22 at 05:02
  • @Nithin Gadhiya, the cmd line tools is already installed and still that command didn't work – srk_sync Oct 20 '22 at 07:14
  • @srk_sync I found other solution, ~/Library/Android/sdk/cmdline-tools/latest/bin/sdkmanager --licenses – Nitin Gadhiya Oct 20 '22 at 08:42
  • No, I tried this already and it too asks for reviewing the licenses instead of automatically accepting them. – srk_sync Oct 21 '22 at 03:33

0 Answers0