Recientemente instalé Ionic pero hasta ahora no he podido compilar ningún proyecto. Ésta es la versión de Ionic:
PS C:\Users\Erik\Desktop\App1> ionic -v
3.19.0
Y ésta es la de cordova:
PS C:\Users\Erik\Desktop\App1> cordova -v
8.0.0
Sí tengo las variables de entorno en Windows del JDK y el SDK. Al momento de compilar un proyecto nuevo sin nada agregado me marca el siguiente error (ya con la plataforma de android instalada):
PS C:\Users\Erik\Desktop\App1> ionic cordova build android
Running app-scripts build: --platform android --target cordova
[02:19:17] build dev started ...
[02:19:18] clean started ...
[02:19:18] clean finished in 362 ms
[02:19:18] copy started ...
[02:19:22] deeplinks started ...
[02:19:22] deeplinks finished in 603 ms
[02:19:23] transpile started ...
[02:20:10] transpile finished in 46.97 s
[02:20:10] preprocess started ...
[02:20:10] preprocess finished in 9 ms
[02:20:10] webpack started ...
[02:20:10] copy finished in 52.22 s
[02:21:04] webpack finished in 54.43 s
[02:21:04] sass started ...
Without `from` option PostCSS could generate wrong source map and will not find Browserslist config. Set it to CSS file path or to `undefined` to prevent this warning.
[02:21:22] sass finished in 17.62 s
[02:21:23] postprocess started ...
[02:21:24] postprocess finished in 1.56 s
[02:21:24] lint started ...
[02:21:25] build dev finished in 127.26 s
> cordova build android
Android Studio project detected
ANDROID_HOME=C:\Users\Erik\AppData\Local\Android\sdk
JAVA_HOME=C:\Program Files\Java\jdk1.8.0
studio
Subproject Path: CordovaLib
Subproject Path: app
FAILURE: Build failed with an exception.
* Where:
Build file 'C:\Users\Erik\Desktop\App1\platforms\android\CordovaLib\build.gradle' line: 40
* What went wrong:
A problem occurred evaluating project ':CordovaLib'.
> Failed to apply plugin [id 'com.android.library']
> Could not create plugin of type 'LibraryPlugin'.
> java/io/UncheckedIOException
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
* Get more help at https://help.gradle.org
BUILD FAILED in 10s
(node:5192) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): Error: cmd: Command failed with exit code
Aquí el archivo donde está el error:
buildscript {
repositories {
jcenter()
maven {
url "https://maven.google.com"
}
}
dependencies {
classpath 'com.android.tools.build:gradle:3.0.0'
classpath 'com.github.dcendents:android-maven-gradle-plugin:1.5'
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.7.3'
}
}
->Linea 40 apply plugin: 'com.android.library'
apply plugin: 'com.github.dcendents.android-maven'
apply plugin: 'com.jfrog.bintray
Al compilar el mismo proyecto en Android Studio no tengo problemas pero es un poco fastidioso cambiar de Ionic a Android Studio. Agradezco cualquier aporte