1

muy buenas, tengo un problema al compilar mi aplicacion, cuando agrego la plataforma ningun problema (ionic cordova platform add android), de hecho ejecuto ionic cordova prepare android y todo va muy bien, la puedo abrir en el android studio sin problemas, mi error surge cuando la quiero compilar, ya he buscado en google, y no he podido solucionarlo, segun lo que leo, me parece que tiene que ver con gradle.

Primero Ejecute:

cordova build android

Checking Java JDK and Android SDK versions
ANDROID_SDK_ROOT=/usr/local/share/android-sdk (recommended setting)
ANDROID_HOME=/usr/local/share/android-sdk (DEPRECATED)
Subproject Path: CordovaLib
Subproject Path: app
/Users/javier/Developer/Proyectos/TeamElite/CarryApp/Ionic4/APP_TRUCK_FRONT/platforms/android/gradlew: Command failed with exit code EACCES

y ahi me dio el error, por lo que despues lo ejecute con la bandera --verbose para obtener mas informacion:

cordova build --verbose android

No scripts found for hook "before_build".
No scripts found for hook "before_prepare".
Checking config.xml and package.json for saved platforms that haven't been added to the project
Config.xml and package.json platforms are the same. No pkg.json modification.
Package.json and config.xml platforms are different. Updating config.xml with most current list of platforms.
PlatformApi successfully found for platform android
Checking for saved plugins that haven't been added to the project
Checking for any plugins added to the project that have not been installed in android platform
No differences found between plugins added to project and installed in android platform. Continuing...
Generating platform-specific config.xml from defaults for android at /platforms/android/app/src/main/res/xml/config.xml
Merging project's config.xml into platform-specific android config.xml
[Gradle Properties] Preparing Configuration
[Gradle Properties] Appending default configuration properties
[Gradle Properties] Appending custom configuration properties
[Gradle Properties] Updating and Saving File
Merging and updating files from [www, platforms/android/platform_www] to platforms/android/app/src/main/assets/www
platforms/android/app/src/main/res/drawable-port-xxxhdpi/screen.png (updated file)
This app does not have additional resource files defined
Prepared android project successfully
No scripts found for hook "after_prepare".
No scripts found for hook "before_compile".
Checking Java JDK and Android SDK versions
ANDROID_SDK_ROOT=/usr/local/share/android-sdk (recommended setting)
ANDROID_HOME=/usr/local/share/android-sdk (DEPRECATED)
Subproject Path: CordovaLib
Subproject Path: app
Running command: 
/platforms/android/gradlew cdvBuildDebug -b 
/platforms/android/build.gradle
Command finished with error code EACCES: 
/platforms/android/gradlew cdvBuildDebug,-b,
/platforms/android/build.gradle
/platforms/android/gradlew: Command failed with exit code EACCES
Error: 
/platforms/android/gradlew: Command failed with exit code EACCES
    at ChildProcess.whenDone (/node_modules/cordova-common/src/superspawn.js:125:23)
    at ChildProcess.emit (events.js:193:13)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:253:12)
    at onErrorNT (internal/child_process.js:429:16)
    at processTicksAndRejections (internal/process/task_queues.js:81:17)
2
  • yo también tengo el mismo problema, se agradece que se publique la solución de ser encontrada. Saludos.
    – Team Elite
    Commented el 2 may. 2019 a las 16:57
  • 1
    @TeamElite ¿Cuál es tu relación con Jorge Javier? ¿sois la misma persona?
    – Alvaro Montoro
    Commented el 2 may. 2019 a las 17:43

2 respuestas 2

4

Simplemente deben darle permisos al archivo gradlew:

chmod 777 platforms/android/gradlew

con esto baja la version correcta u debe funcionar...espero les sirva

0

Es un problema de permisos de gradle. Tienes que ejecutar los siguientes comandos:

$ chmod a+x <your-project-directory>/platforms/android/gradlew
$ chmod a+x <your-project-directory>/platforms/android/cordova/build

Saludos.

Tu Respuesta

By clicking “Publica tu respuesta”, you agree to our terms of service and acknowledge you have read our privacy policy.

¿No es la respuesta que buscas? Examina otras preguntas con la etiqueta o formula tu propia pregunta.