Flutter安装Gradle问题 [英] Flutter Install Gradle Issues

查看:137
本文介绍了Flutter安装Gradle问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用flutter运行一个基本的 hello world 项目.这些是我在运行Window 10 Pro的Windows机器上安装Flutter所采取的步骤.

I'm trying to get a basic hello world project running using flutter. These are the steps that I have taken to install Flutter on a windows machine, running Window 10 Pro.

1)下载flutter_windows_v0.9.4-beta.zip并解压缩到c:\ src \

1) Downloaded flutter_windows_v0.9.4-beta.zip and extracted to c:\src\

2)将位置添加到环境设置... C:\ src \ flutter

2) Add location to environment settings ... C:\src\flutter

3)下载并安装了Android Studio,并使用ADV Manager设置了模拟器.

3) Downloaded and installed Android Studio and Setup an emulator using ADV Manager.

4)下载并安装了Visual Studio代码

4) Downloaded and installed Visual Studio Code

5)添加了Dart 2.19.0扩展

5) Added Dart 2.19.0 Extension

6)添加了Flutter 2.19.0扩展

6) Added Flutter 2.19.0 Extension

7)运行Flutter医生

7) Run Flutter doctor

[flutter] flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[√] Flutter (Channel beta, v0.9.4, on Microsoft Windows [Version 10.0.15063], locale en-GB)
[√] Android toolchain - develop for Android devices (Android SDK 28.0.3)
[√] Android Studio (version 3.2)
    X Flutter plugin not installed; this adds Flutter specific functionality.
    X Dart plugin not installed; this adds Dart specific functionality.
[√] VS Code (version 1.28.2)
[√] Connected devices (1 available)

8)创建一个新的flutter项目

8) Create a new flutter project

9)删除测试"文件夹下的代码

9) Deleted code under Test folder

10)将main.dart中的代码替换为...

10) Replaced code in main.dart with ...

import 'package:flutter/material.dart';

void main() {
  runApp(Center(
    child: Text(
      "this is a test",
      textDirection: TextDirection.ltr,
    ),
  ));
}

11)运行项目并出现以下错误...

11) Ran project and get the following error ...

Launching lib\main.dart on Android SDK built for x86 in debug mode...
* Error running Gradle:
Exit code 1 from: C:\Users\to0589\Desktop\flutter projects\asad\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\to0589\Desktop\flutter projects\asad\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 1s
Please review your Gradle project setup in the android/ folder.
Exited (sigterm)

有人可以告诉我我哪里出问题了吗?任何帮助都将不胜感激.

Can anyone tell me where I went wrong please ? Any assistance greatly appreciated.

亲切的问候,

蒂姆

推荐答案

在您的安装中这不是问题.这是许多人当前的flutter版本面临的问题.

That's not a problem in your install. This is a problem that many people are facing with current flutter version.

它已经已修复.但是,它尚未发布到最稳定的版本.

It's already fixed. However, it's not yet released to the most stable version.

如果将flutter channel更改为master,则会看到它可以正常运行.

If you change the flutter channel to master, you'll see that it will run normally.

您现在可以使用主频道,然后将其切换回dev.

You can use the master channel for now and then switch it back to dev.

flutter channel master
flutter upgrade

# to see all the channels, run
flutter channel

这篇关于Flutter安装Gradle问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆