May 19, 2019

Failed to Install the Following Android SDK Packages as Some Licences Have Not Been Accepted

A few days ago, I had time to try to build an Android project but did not use the Android Studio application but instead used the command line. In order for the source code to be built using only the command line, we can use the included sdkmanager to download other SDK packages, this is a basic Android command line tool, if you want to download visit the Android Developer page then adjust with your environment. Besides that I also use Gradle Wrapper and follow the existing setup guidelines.

After following a few steps in the build guide, it finally arrived at the step where the source code will soon be built into an Android APK. After a few minutes the development process began, the development process suddenly stopped and gave an error message Failed to install the following Android package because some SDK licenses have not been received. The first thing I say is “Hai error” 🤣

To solve this problem I followed a number of references on the internet, I followed the guidelines to be able to accept the SDK license and here I found a new error message Exception in thread "playing" java.lang.NoClassDefFoundError: javax/xml/bind/annotation/XML Schema.

Here I was confused, then I tried asking my friend. After asking this to my friend, my friend was also made confused. After several hours of searching for a solution to this problem but it has not been resolved as well, we matched the environment used and at the end of checking this problem can be solved. It turns out that the error that appears when receiving the SDK license is that the java version used is different.

Now the Java version is equalized, trying to accept the SDK license and finally error Exception in thread "error playing" java.lang.NoClassDefFoundError: javax/xml/bind/annotation/XmlSchema doesn’t appear. Then try again to run the stage of building Andorid APK and the APK was successfully built.

Thank you Alif Firdaus for helping.

References