1、 Error information
* What went wrong:
A problem occurred configuring project ':app'.
&> You have not accepted the license agreements of the following SDK components:
[Android SDK Build-Tools 26.0.3, Android SDK Platform 26].
Before building your project, you need to accept the license agreements and complete the installation of the missing components using the Android Studio SDK Manager.
Alternatively, to learn how to transfer the license agreements from one workstation to another, go to http://d.android.com/r/studio-ui/export-licenses.html
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
2、 Cause of error
Starting from Android gradle plugin 2.2.0, gradle will automatically load the required SDK and build tools. However, because it does not accept the license, the loading dependency is terminated.
3、 Solutions
(1) Find your own Android SDK location and enter the tools/bin directory
(2) Open CMD (do not use any other one) and enter the above directory
(3) Enter the following command
sdkmanager.bat --licenses
(4) After input, a lot of things will pop up. We just need to write y in all of them
(5) Success tips
Similar Posts:
- Could not find com.android.tools.build:gradle:3.3.0.
- Gradle‘s dependency cache may be corrupt [How to Solve]
- Error:(1, 0) Plugin with id ‘android’ not found.
- Plugin is too old, please update to a more recent
- [Solved] Android Studio Error: Could not initialize class com.android.sdklib.repository.AndroidSdkHandler
- AS Import Project Error: Plugin with id ‘com.android.application’ not found.
- [Solved] Android Gradle plugin requires Java 11 to run. You are currently using Java 1.8
- [Solved] Android Studio Error: Could not initialize class com.android.sdklib.repository.AndroidSdkHandler
- Flutter: Android dependency ‘com.android.support:support-v4’ has different version …
- Caused by: org.gradle.api.internal.plugins.PluginApplicationException: Failed to apply plugin [id ‘com.android.internal.application’]