Post

Flutter HelloWorld

Android Studio 环境搭建

查看 Android SDK

安装 Android Studio 查看安装 Android SDK 位置

1
File->other Settings -> Defaylt Project Structure

可以看到 Android SDK location

Android Studio 中安装 Flutter 插件

1
Android Studio->Perfernces->Plugins->Marketplace(See flutter)->install->Restart IDE

编写第一个 Flutter

https://flutterchina.club/get-started/test-drive/

使用终端

  • flutter create myapp
  • cd myApp
  • flutter devices
1
2
3
1 connected device:

COL AL10 • 9YEDU18427028281 • android-arm64 • Android 10 (API 29)

使用 Android Studio

Error Build Tools revision 28.0.3
1
2
3
4
5
6
7
8
9
10
11
12
13
FAILURE: Build failed with an exception.

* What went wrong:
Could not determine the dependencies of task ':app:compileDebugJavaWithJavac'.
> Failed to find Build Tools revision 28.0.3

* 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 1m 10s
Exception: Gradle task assembleDebug failed with exit code 1

解决方案

  • 再开启一个 Android Stucio
  • 打开 flutter 中 Android 文件为一个项目(项目初始化 ok 后)
1
Tools->SDK Manager->SDK Tools(点击[Show Package Details])->☑️28.0.3->Apply(ok) 即可

AVD 安装

1
Create Virtual Device ->Phone->选择规格
This post is licensed under CC BY 4.0 by the author.