Cordova Build Gradle Error while opening/extracting zip file

后端 未结 4 2033
傲寒
傲寒 2021-01-02 00:36

When I Run: cordova build, I got this:

Running command:/Users/tyrant/workspace/ideaProject/hello/platforms/android/cordova/build
ANDROID_HOME=/Users/tyrant/s         


        
相关标签:
4条回答
  • 2021-01-02 01:00

    This is because you have already downloaded a corrupt version of the Gradle package in your system directory. (Maybe due to internet connection issues?) Just go to your local path below and remove all contents inside it.

    /Users/tyrant/.gradle/wrapper/dists/gradle-2.2.1-all/2m8005s69iu8v0oiejfej094b/

    Run cordova build again. This will fix your issue for sure.

    0 讨论(0)
  • 2021-01-02 01:05

    For anyone facing this problem when first building a react-native Android app, it's likely to be the gradle-2.4 file, which is generally found in:

    /var/root/.gradle/wrapper/dists/gradle-2.4-all/<some_string>/gradle-2.4
    

    Just manually delete the zip file, download a new copy and replace.

    0 讨论(0)
  • 2021-01-02 01:19

    Check whether you are having download limit and, if so, download the gradle zip file manually, place it in folder such as /Users/tyrant/.gradle/wrapper/dists/gradle-2.2.1-all/2m8005s69iu8v0oiejfej094b/ and run the command.

    0 讨论(0)
  • 2021-01-02 01:23

    I read a lot of this problem, and i found 2 solutions, the 1st one is to remove all contents inside it (as the last post said) but it doesn't work for all, in my case don`t.

    The other solution is to put in a local folder of the project the zip file and change the path, and that is not a real solution, cause the size is 50 mb...

    So the easiest way i found is just download the right zip from the Gradle site--> https://services.gradle.org/distributions and just replace it in your computer manually... and this works instantly for me.

    0 讨论(0)
提交回复
热议问题