简体   繁体   English

无法运行 Flutter 应用程序 - 不支持的 gradle 项目

[英]Unable to run Flutter app - Unsupported gradle project

I'm trying to run my flutter app.我正在尝试运行我的颤振应用程序。 However when I try to run my app I get an error that I can not find anything about但是,当我尝试运行我的应用程序时,我收到一个错误,我找不到任何关于

C:\\Users\\Larson Carter\\Desktop\\kamino-master (1)>flutter run Launching lib\\main.dart on ONEPLUS A6013 in debug mode... [!] Your app is using an unsupported Gradle project. C:\\Users\\Larson Carter\\Desktop\\kamino-master (1)>flutter run Launching lib\\main.dart on ONEPLUS A6013 in debug mode... [!] 你的应用正在使用一个不受支持的 Gradle 项目。 To fix this problem, create a new project by running flutter create -t app <app-directory> and then move the dart code, assets and pubspec.yaml to the new project.要解决此问题,请通过运行flutter create -t app <app-directory>创建一个新项目,然后将 dart 代码、资产和 pubspec.yaml 移动到新项目中。

I'm running the latest version of android studio, flutter, dart and my packages are up to date.我正在运行最新版本的 android studio、flutter、dart 并且我的软件包是最新的。 And I still can not find a solution.我仍然找不到解决方案。

First You need to install flutter sdk.. Then initialize sdk in environmental variables.首先需要安装flutter sdk..然后在环境变量中初始化sdk。 Then Open Android Studio And give the path of flutter sdk and then create project/然后打开Android Studio并给出flutter sdk的路径然后创建项目/

Please check launch.json file
{
    // Use IntelliSense to learn about possible attributes.
    // Hover to view descriptions of existing attributes.
    // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
    "version": "0.2.0",
    "configurations": [
        {
            "name": "Flutter",
            "request": "launch",
            "type": "dart"
        }
    ]
}


Make sure using latest gradle. Check it in android -> gradle -> gradle-wrapper.properties file

检查如何打开launch.json文件

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM