I have a problem when trying to compile my Android application. I am using cordova, more specifically version 10.0.0.
cd C:\xampp\htdocs\app
npm install -g cordova
cordova create MyApp
cd MyApp
cordova platform add android
The problem appears when I try to compile my project:
cd C:\xampp\htdocs\app\MyApp
cordova build android
I also added the environment variables ANDROID_SDK_ROOT, JAVA_HOME, ANDROID_HOME, and in the "path" variable I added my gradle version.
Reading that it was a permissions problem with licenses, I tried to run in the terminal "flutter doctor --android-licenses" which accepted all the licenses. I have tried everything I could think of and I have had no way to solve it, here are the details of the error:
Checking Java JDK and Android SDK versions
ANDROID_SDK_ROOT=C:\Users\yo\AppData\Local\Android\Sdk (recommended setting)
ANDROID_HOME=C:\Program Files\Java\jdk1.8.0_171 (DEPRECATED)
Using Android SDK: C:\Users\yo\AppData\Local\Android\Sdk
Subproject Path: CordovaLib
Subproject Path: app
Checking the license for package Android SDK Platform-Tools in C:\Program Files\Java\jdk1.8.0_171\licenses
Warning: License for package Android SDK Platform-Tools not accepted.
Checking the license for package SDK Patch Applier v4 in C:\Program Files\Java\jdk1.8.0_171\licenses
Warning: License for package SDK Patch Applier v4 not accepted.
Checking the license for package Android Emulator in C:\Program Files\Java\jdk1.8.0_171\licenses
Warning: License for package Android Emulator not accepted.
Checking the license for package Android SDK Tools in C:\Program Files\Java\jdk1.8.0_171\licenses
Warning: License for package Android SDK Tools not accepted.
Checking the license for package Android SDK Build-Tools 29.0.2 in C:\Program Files\Java\jdk1.8.0_171\licenses
Warning: License for package Android SDK Build-Tools 29.0.2 not accepted.
Checking the license for package Android SDK Platform 29 in C:\Program Files\Java\jdk1.8.0_171\licenses
Warning: License for package Android SDK Platform 29 not accepted.
FAILURE: Build failed with an exception.
* What went wrong:
Could not determine the dependencies of task ':app:compileDebugJavaWithJavac'.
> Failed to install the following Android SDK packages as some licences have not been accepted.
patcher;v4 SDK Patch Applier v4
emulator Android Emulator
platforms;android-29 Android SDK Platform 29
tools Android SDK Tools
build-tools;29.0.2 Android SDK Build-Tools 29.0.2
platform-tools Android SDK Platform-Tools
To build this project, accept the SDK license agreements and install the missing components using the Android Studio SDK Manager.
Alternatively, to transfer the license agreements from one workstation to another, see http://d.android.com/r/studio-ui/export-licenses.html
Using Android SDK: C:\Program Files\Java\jdk1.8.0_171
* 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
Does anyone know what I could do? I just want to create an android application from a web application in the simplest way, although it is emulated and not native. Thank you in advance