导入flutter项目Finished with error:

2019-11-09  本文已影响0人  Berlin麒麟

错误描述

Finished with error: ProcessException: Process "D:\HelloFlutter\ycflutter\android\gradlew.bat" exited abnormally:

Exception in thread "main" java.lang.NullPointerException

at org.gradle.wrapper.BootstrapMainStarter.findLauncherJar(BootstrapMainStarter.java:34)

at org.gradle.wrapper.BootstrapMainStarter.start(BootstrapMainStarter.java:25)

at org.gradle.wrapper.WrapperExecutor.execute(WrapperExecutor.java:129)

at org.gradle.wrapper.GradleWrapperMain.main(GradleWrapperMain.java:61)

  Command: D:\HelloFlutter\ycflutter\android\gradlew.bat -v

解决办法

错误原因是因为导入项目的gradle版本在本地没有

修改flutter项目中android\gradle\wrapper\gradle-wrapper.properties文件中distributionUrl路径为你本地存在的版本

或者下载该项目中需要的版本copy压缩包到C:\Users\**\.gradle\wrapper\dists\+对应版本文件下(无需解压)

上一篇下一篇

猜你喜欢

热点阅读