resolved! Failed to install the following Android SDK packages licences have not been accepted
Here is the stacktrace :
Parallel execution with configuration on demand is an incubating feature.
The Task.leftShift(Closure) method has been deprecated and is scheduled to be removed in Gradle 5.0. Please use Task.doLast(Action) instead.
at build_a9uydmmhn77pqdiktyzizamyr.run(/app/workingdir/android/sdk31/android-shell-app/ReactAndroid/build.gradle:141)
(Run with --stacktrace to get the full stack trace of this deprecation warning.)
WARNING: Configuration 'compile' is obsolete and has been replaced with 'implementation' and 'api'.
It will be removed at the end of 2018. For more information see: http://d.android.com/r/tools/update-dependency-configurations.html
Checking the license for package Android SDK Build-Tools 27.0.3 in /usr/local/android-sdk-linux/licenses
Warning: License for package Android SDK Build-Tools 27.0.3 not accepted.
Checking the license for package Android SDK Platform 27 in /usr/local/android-sdk-linux/licenses
Warning: License for package Android SDK Platform 27 not accepted.
Checking the license for package Android SDK Build-Tools 27.0.3 in /usr/local/android-sdk-linux/licenses
Warning: License for package Android SDK Build-Tools 27.0.3 not accepted.
Checking the license for package Android SDK Platform 27 in /usr/local/android-sdk-linux/licenses
Warning: License for package Android SDK Platform 27 not accepted.
[stderr] FAILURE: Build failed with an exception.
[stderr] * What went wrong:
[stderr] A problem occurred configuring project ':ReactAndroid'.
[stderr] > Failed to notify project evaluation listener.
[stderr] > Failed to install the following Android SDK packages as some licences have not been accepted.
[stderr] platforms;android-27 Android SDK Platform 27
[stderr] build-tools;27.0.3 Android SDK Build-Tools 27.0.3
[stderr] To build this project, accept the SDK license agreements and install the missing components using the Android Studio SDK Manager.
[stderr] Alternatively, to transfer the license agreements from one workstation to another, see http://d.android.com/r/studio-ui/export-licenses.html
[stderr]
D:\VueNative\demo>react-native run-android
(node:10776) Warning: Accessing non-existent property 'padLevels' of module expo
rts inside circular dependency
(Use `node --trace-warnings ...` to show where the warning was created)
info JS server already running.
info Building and installing the app on the device (cd android && gradlew.bat ap
p:installDebug)...
> Configure project :app
File C:\Users\Administrator\.android\repositories.cfg could not be loaded.
Checking the license for package Android SDK Build-Tools 28.0.3 in C:\Users\Admi
nistrator\AppData\Local\Android\Sdk\licenses
Warning: License for package Android SDK Build-Tools 28.0.3 not accepted.
Checking the license for package Android SDK Platform 28 in C:\Users\Administrat
or\AppData\Local\Android\Sdk\licenses
Warning: License for package Android SDK Platform 28 not accepted.
FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred configuring project ':app'.
> Failed to install the following Android SDK packages as some licences have not
been accepted.
build-tools;28.0.3 Android SDK Build-Tools 28.0.3
platforms;android-28 Android SDK Platform 28
To build this project, accept the SDK license agreements and install the missi
ng components using the Android Studio SDK Manager.
Alternatively, to transfer the license agreements from one workstation to anot
Using Android SDK: C:\Users\Administrator\AppData\Local\Android\Sdk
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug
option to get more log output. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
Deprecated Gradle features were used in this build, making it incompatible with
Gradle 7.0.
Use '--warning-mode all' to show the individual deprecation warnings.
d_line_warnings
BUILD FAILED in 2s
error Could not install the app on the device, read the error above for details.
Make sure you have an Android emulator running or a device connected and have
set up your Android development environment:
error Command failed: gradlew.bat app:installDebug. Run CLI with --verbose flag
for more details.
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 threa
0 Comments: