Launching lib\main.dart on Android SDK built for x86 in debug mode...
初始化gradle ... 错误结束:ProcessException:进程
C:\Users\Acer\AndroidStudioProjects\encarta_first_app\android\gradlew.bat" exited abnormally:
Unzipping C:\Users\Acer\.gradle\wrapper\dists\gradle-4.10.2-all\9fahxiiecdb76a5g3aw9oi8rv\gradle-4.10.2-all.zip to C:\Users\Acer\.gradle\wrapper\dists\gradle-4.10.2-all\9fahxiiecdb76a5g3aw9oi8rv
Exception in thread "main" 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:225)
at java.util.zip.ZipFile.<init>(ZipFile.java:155)
at java.util.zip.ZipFile.<init>(ZipFile.java:169)
at org.gradle.wrapper.Install.unzip(Install.java:214)
at org.gradle.wrapper.Install.access$600(Install.java:27)
at org.gradle.wrapper.Install$1.call(Install.java:74)
at org.gradle.wrapper.Install$1.call(Install.java:48)
at org.gradle.wrapper.ExclusiveFileAccessManager.access(ExclusiveFileAccessManager.java:65)
at org.gradle.wrapper.Install.createDist(Install.java:48)
at org.gradle.wrapper.WrapperExecutor.execute(WrapperExecutor.java:128)
at org.gradle.wrapper.GradleWrapperMain.main(GradleWrapperMain.java:61)
命令:C:\Users\Acer\AndroidStudioProjects\encarta_first_app\android\gradlew.bat -v
答案 0 :(得分:0)
它是因为您的计算机上没有gradle-4.10.2版本。 使用Visual Studio Code的解决方案1: 1.转到文件夹菜单android-> gradle-> graddle-wrapper.properties 2.将gradle版本更改为您的计算机版本
示例:我在笔记本电脑上安装了gradle版本5.4.1
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/**gradle-5.4.1**-all.zip