Cause: error in opening zip file (android-studio)

后端 未结 7 1149
旧时难觅i
旧时难觅i 2021-02-04 16:46

When I create a new project I finish the steps and click on \"finish\" and wait for the project to open. But instead I see an error:

7条回答
  •  刺人心
    刺人心 (楼主)
    2021-02-04 17:11

    My Installation & problem details

    I had this issue after importing a github project into Android Studio using the File > Import Project option. Network was fine and I had other Android Studio projects working properly so this was not a installation issue. I run Android Studio (Preview) 0.5.4

    enter image description here

    The solution that worked for me

    I had the luxury of comparing differences with working projects. That is how I discovered the error was due to the distributionUrl property in the gradle/wrapper/gradle-wrapper.properties file.

    In the failing project this was set like distributionUrl=http\://services.gradle.org/distributions/gradle-1.10-all.zip. While in the working project this was distributionUrl=http\://services.gradle.org/distributions/gradle-1.11-all.zip. Note the difference in the version.

    Updating this distributionUrl in gradle-wrapper.properties to this 1.11 link solved the issue for me.

    About the Network

    I have this issue on a very restricted network and I can see that the gradle-1.10 link does point to a zip file. The network issue sounds very plausible to. Probably I already have the 1.11 zip downloaded while on another network. I's less likely (though not impossible) that the 1.10 zip is broken.

提交回复
热议问题