Solucionado (ver solução)
Solucionado
(ver solução)
5
respostas

Erro ao Executar "cordova platform add android"

Ao tentar usar o "cordova platform add android" aparece isso o que fazer??

Adding android project...
Creating Cordova project for the Android platform:
        Path: platforms\android
        Package: org.tc.garconapp
        Name: Gar_onete_So_de_Cenoura
        Activity: MainActivity
        Android target: android-24
Subproject Path: CordovaLib
Android project created with cordova-android@6.0.0
Installing "cordova-plugin-whitelist" for android
ANDROID_HOME=C:\Users\Usuario\AppData\Local\Android\sdk
JAVA_HOME=C:\Program Files\Java\jdk1.8.0_40
Subproject Path: CordovaLib
Unzipping C:\Users\Usuario\.gradle\wrapper\dists\gradle-2.14.1-all\53l0mv9mggp9q5m2ip574m21oh\gradle-2.14.1-all.zip to C:\Users\Usuario\.gradle\wrapper\dists\gradle-2.14.1-all\53l0mv9mggp9q5m2ip574m21oh
Exception in thread "main" java.lang.RuntimeException: java.util.zip.ZipException: error in opening zip file
        at org.gradle.wrapper.ExclusiveFileAccessManager.access(ExclusiveFileAccessManager.java:78)
        at org.gradle.wrapper.Install.createDist(Install.java:47)
        at org.gradle.wrapper.WrapperExecutor.execute(WrapperExecutor.java:129)
        at org.gradle.wrapper.GradleWrapperMain.main(GradleWrapperMain.java:48)
Caused by: java.util.zip.ZipException: error in opening zip file
        at java.util.zip.ZipFile.open(Native Method)
        at java.util.zip.ZipFile.<init>(ZipFile.java:220)
        at java.util.zip.ZipFile.<init>(ZipFile.java:150)
        at java.util.zip.ZipFile.<init>(ZipFile.java:164)
        at org.gradle.wrapper.Install.unzip(Install.java:160)
        at org.gradle.wrapper.Install.access$400(Install.java:29)
        at org.gradle.wrapper.Install$1.call(Install.java:70)
        at org.gradle.wrapper.Install$1.call(Install.java:47)
        at org.gradle.wrapper.ExclusiveFileAccessManager.access(ExclusiveFileAccessManager.java:65)
        ... 3 more
Failed to install 'cordova-plugin-whitelist':Error: cmd: Command failed with exit code 1
    at ChildProcess.whenDone (C:\xampp\htdocs\cordova\garconapp\platforms\android\cordova\node_modules\cordova-common\src\superspawn.js:169:23)
    at emitTwo (events.js:106:13)
    at ChildProcess.emit (events.js:191:7)
    at maybeClose (internal/child_process.js:885:16)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:226:5)
Error: cmd: Command failed with exit code 1
5 respostas

Deu algum erro no download do Gradle. Apaga essa pasta toda e tenta de novo:

C:\Users\Usuario\.gradle\wrapper\dists

Infelizmente não funcionou.

Mas dá o mesmo erro? ZipException no gradle.zip?

Que prazer em lhe ver por aqui Thailsson.

Um forte abraço e bom estudo!

solução!

Eu apaguei tudo que tinha referente a Android(Fora o SDK) e Tentei novamente então ele baixou tudo novamente e pegou!!!

Agora funcionou!! Valeu Sérgio Lopes!!! Continuar esse curso Agora!!! Saudações Mateus!!!