当前位置: 首页 > 知识库问答 >
问题:

我无法在VS代码中运行和调试颤振应用程序,每当我尝试运行它时,就会出现以下错误[重复]

靳举
2023-03-14
  • 我使用的是颤振0.9。4•频道测试版

每当我尝试调试并运行我的应用程序时,它都会显示以下错误消息:

Launching lib\main.dart on Custom Phone, 8 0, API 26, 768x1280 in debug mode...
* Error running Gradle:
Exit code 1 from: C:\Users\Ketan\Documents\Flutter\hello\android\gradlew.bat app:properties:
Project evaluation failed including an error in afterEvaluate {}. Run with --stacktrace for details of the afterEvaluate {} error.

FAILURE: Build failed with an exception.

* Where:
Build file 'C:\Users\Ketan\Documents\Flutter\hello\android\app\build.gradle' line: 25

* What went wrong:
A problem occurred evaluating project ':app'.
> Could not resolve all files for configuration 'classpath'.
   > Could not find lint-gradle-api.jar (com.android.tools.lint:lint-gradle-api:26.1.2).
     Searched in the following locations:
         https://jcenter.bintray.com/com/android/tools/lint/lint-gradle-api/26.1.2/lint-gradle-api-26.1.2.jar

* 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
Please review your Gradle project setup in the android/ folder.

共有1个答案

微生学
2023-03-14

从颤振文档中尝试以下操作:

更新您的路径

如果您希望在常规的Windows命令提示符中运行Flutter命令,请执行以下步骤将Flutter添加到PATH环境变量:

”控制面板

>

  • 在用户变量下,检查是否有一个名为路径的条目:

    如果条目确实存在,请使用将完整路径附加到flatter\bin;作为现有值的分隔符。

    如果条目不存在,请创建一个名为Path的新用户变量,其值为完整的Pathtoflatter\bin。重新启动Windows以完全应用此更改。

  •  类似资料: