中文flutter网站 :https://flutterchina.club/setup-windows/
外网 https://flutter.dev/docs/get-started/install/windows
各位同鞋可自行选择。
流程再这里就不多讲,根据文档来就可以。但是编译器的不同,遇到问题千出白怪,收集了几条常见的问题。
安装过程中遇到的
问题一
X] Android toolchain - develop for Android devices X Flutter requires Android SDK 28 and the Android BuildTools 28.0.3
To update using sdkmanager, run:
"C:\Users\Kim\AppData\Local\Android\sdk\tools\bin\sdkmanager" "platforms;android-28" "build-tools;28.0.3"
or visit https://flutter.dev/setup/#android-setup for detailed instructions.
本地的sdk目录内是已经下载的,但看到https://stackoverflow.com/questions/49175231/flutter-does-not-find-android-sdk中,我不得不怀疑"build-tools;28.0.3",是否是完整版,卸载之后重新下载完成,并进行flutter doctor -v,问题解决。
还有一种情况,需要进行下载相应的sdk即可。
问题二
[!] Android toolchain - develop for Android devices (Android SDK version 29.0.1)
• Android SDK at D:\Android\sdk • Android NDK location not configured (optional; useful for native profiling support)
• Platform android-29, build-tools 29.0.1
• ANDROID_HOME = D:\Android\sdk
• Java binary at: D:\androistudio\jre\bin\java
• Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1343-b01)
! Some Android licenses not accepted. To resolve this, run: flutter doctor --android-licenses
根据最后一行! Some Android licenses not accepted. To resolve this, run: flutter doctor --android-licenses 在flutter console中,运行flutter doctor --android-licenses 相应代码即可。
行有不得,反求诸己。--《孟子·离娄上》
网友评论