【发布时间】:2019-03-30 14:40:34
【问题描述】:
我正在尝试使用 Flutter 运行一个基本的 hello world 项目。这些是我在运行 Window 10 Pro 的 Windows 机器上安装 Flutter 所采取的步骤。
-
下载
flutter_windows_v0.9.4-beta.zip并解压到c:\src\ -
将位置添加到环境设置...
C:\src\flutter -
下载并安装 Android Studio 并使用 ADV Manager 设置模拟器。
-
已下载并安装 Visual Studio Code
-
添加了 Dart 2.19.0 扩展
-
添加了 Flutter 2.19.0 扩展
-
运行 Flutter 医生
[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)
-
新建一个flutter项目
-
Test文件夹下的已删除代码
-
将
main.dart中的代码替换为...
import 'package:flutter/material.dart';
void main() {
runApp(Center(
child: Text(
"this is a test",
textDirection: TextDirection.ltr,
),
));
}
- 运行项目并得到以下错误...
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)
谁能告诉我哪里出了问题,非常感谢任何帮助。
【问题讨论】:
标签: gradle installation flutter