H5W3
当前位置:H5W3 > Flutter > 正文

【flutter】flutter报错:* Error running Gradle:

android studio安装flutter插件后新建项目,运行时超时,已更换阿里云镜像
再次运行时遇见异常:

* Error running Gradle:
ProcessException: Process "E:\app\demo\android\gradlew.bat" exited abnormally:
> Configure project :app
NDK is missing a "platforms" directory.
If you are using NDK, verify the ndk.dir is set to a valid NDK directory.  It is currently set to C:\Users\Administrator\AppData\Local\Android\Sdk\ndk-bundle.
If you are not using NDK, unset the NDK variable from ANDROID_NDK_HOME or local.properties to remove this warning.
Project evaluation failed including an error in afterEvaluate {}. Run with --stacktrace for details of the afterEvaluate {} error.
FAILURE: Build failed with an exception.
* Where:
Script 'D:\flutter\flutter\packages\flutter_tools\gradle\flutter.gradle' line: 4
* What went wrong:
Could not compile script 'D:\flutter\flutter\packages\flutter_tools\gradle\flutter.gradle'.
> startup failed:
script 'D:\flutter\flutter\packages\flutter_tools\gradle\flutter.gradle': 4: unable to resolve class com.android.builder.model.AndroidProject
@ line 4, column 1.
import com.android.builder.model.AndroidProject
^
1 error
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
BUILD FAILED in 2s
Command: E:\app\demo\android\gradlew.bat app:properties
Please review your Gradle project setup in the android/ folder.

网上找了也没有遇上合适的答案来解决它,我看到提示import com.android.builder.model.AndroidProject是这个包的问题,请问该如何解决
请各位大佬指点

回答

已解决:
只在build.gradle文件中更换阿里云镜像,在flutter sdk下还是使用flutter下载的配置(之前改过),就可以了

你用命令行试试,flutter create my-app

最终解决了没,我这之前还正常跑的。

本文地址:H5W3 » 【flutter】flutter报错:* Error running Gradle:

评论 0

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址