第一个Flutter应用程式出现问题(Android Studio)

时间:2018-10-30 05:30:34

标签: android-studio flutter

我无法在Android Studio中运行我的第一个Flutter应用

Flutter Doctor -v

[√] Flutter(在Microsoft Windows [Version 10.0.17134.345],语言环境en-US)上输入Channel beta,此处输入v0。9.4在此处输入代码 •位于C:\ development \ flutter enter code here的Flutter 0.9.4版 •框架修订版f37c235(5周前),2018-09-25 17:45:40 -0400 •发动机版本74625aed32 •Dart版本2.1.0-dev.5.0.flutter-a2eb050044

[√] Android工具链-为Android设备开发(Android SDK 27.0.3) •Android SDK位于C:\ Users \ Meteor \ AppData \ Local \ Android \ sdk •未配置Android NDK位置(可选;对本机性能分析支持很有用) •平台android-27,构建工具27.0.3 •ANDROID_HOME = C:\ Users \ Meteor \ AppData \ Local \ Android •Java二进制文件位于:C:\ Program Files \ Android \ Android Studio \ jre \ bin \ java •Java版本OpenJDK运行时环境(内部版本1.8.0_152-release-1136-b06) •接受所有Android许可。

[√] Android Studio(3.2版) •位于C:\ Program Files \ Android \ Android Studio的Android Studio •Flutter插件版本29.1.1 •Dart插件版本181.5656 •Java版本OpenJDK运行时环境(内部版本1.8.0_152-release-1136-b06)

[√]已连接的设备(1个可用) •为x86构建的Android SDK•仿真器-5554•android-x86•Android 7.1.1(API 25)(仿真器)

•找不到问题!

Android Studio(控制台)

Performing hot restart...
Syncing files to device Android SDK built for x86...

Error running Gradle:
Exit code 1 from: C:\Users\Meteor\AndroidStudioProjects\my_flutter_app\android\gradlew.bat app:properties:
Starting a Gradle Daemon, 1 incompatible Daemon could not be reused, use --status for details
Download /dl/android/maven2/com/android/tools/build/gradle/3.1.2/gradle-3.1.2.pom
Download /dl/android/maven2/com/android/tools/build/gradle-core/3.1.2/gradle-core-3.1.2.pom
Download /dl/android/maven2/com/android/tools/build/bundletool/0.1.0-alpha01/bundletool-0.1.0-alpha01.pom

Download /com/android/tools/build/transform-api/2.0.0-deprecated-use-gradle-api/transform-api-2.0.0-deprecated-use-gradle-api.pom
Download /com/android/tools/build/transform-api/2.0.0-deprecated-use-gradle-api/transform-api-2.0.0-deprecated-use-gradle-api.jar
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\Meteor\AndroidStudioProjects\my_flutter_app\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 7m 57s

Finished with error: Please review your Gradle project setup in the android/ folder.

2 个答案:

答案 0 :(得分:0)

尝试在Android Studio中将Android目录作为Android项目打开,然后打开\ app \ build.gradle并单击同步按钮。

答案 1 :(得分:0)

private int id;
private float length;
private String comment;
private int fabricTypeId;

这表明您正在使用旧版本的Gradle。尝试升级到3.2.0。