After reinstalling Windows 10, I am desperately trying to get my LibGDX project to run in IntelliJ again. It will not build because of an Android SDK license issue.
I reinstalled Android Studio and the Android SDK 27, which I had been using in my project before, but I got the following error message:
A problem occurred configuring project ':android'. Failed to install the following Android SDK packages as some licences have not been accepted. platform-tools Android SDK Platform-Tools patcher;v4 SDK Patch Applier v4 platforms;android-27 Android SDK Platform 27 build-tools;27.0.3 Android SDK Build-Tools 27.0.3 emulator Android Emulator tools Android SDK Tools
I found the following thread with lots of suggested fixes:
"Failed to install the following Android SDK packages as some licences have not been accepted" error
So I learned that I have to run
%ANDROID_HOME%/tools/bin/sdkmanager --licenses
It did not work at first because the file /users/MYUSERNAME/.android/repositories.cfg
was missing. I created an empty file at that path, ran sdkmanager
again and accepted all licenses. However, I still get the same error when building my LibGDX project in IntelliJ.
Here is what I have tried to resolve this issue:
- Ran
sdkmanager --licenses
with administrator priviledges - Ran
sdkmanager --update
instead of--licenses
- Installed the Android command line tools and used that
sdkmanager
batch file instead - Made sure that the
%ANDROID_HOME%\licenses
folder exists and contains license files - Made sure that there is not another Android SDK installed on my machine that I am not aware of - both
ANDROID_HOME
andANDROID_SDK_ROOT
(I read that the former is outdated) environment variables point to the same folder that is also configured as Android SDK location in the Android Studio SDK Manager and as an Android SDK home path in my IntelliJ project settings - Selected the JRE that comes with Android Studio as the standard Java runtime environment on my machine (by setting
JAVA_HOME
toC:\Program Files\Android\Android Studio\jre
) - Uninstalled the API 30 SDK that was automatically installed with Android Studio, so I would only have API 27 left
- Tried using the API 30 SDK instead of API 27 by configuring it in the
android\build.gradle
file of my LibGDX project - Uninstalled Android Studio, removed the SDK folder and reinstalled everything
- Added
yes | sdkmanager --licenses
to mygradlew.bat
None of these seemed to help. When I run sdkmanager --licenses
again, the response is
All SDK package licenses accepted.
but IntelliJ keeps saying the opposite.
I am out of ideas how to resolve this. Any help would be highly appreciated.