上一篇後面搞了這麼九,還是失敗了。
改 ref:用VS Code建置Flutter 開發環境。 Download Android Studio,安裝的時候...Android Virtual Device 這一項,要 1G。先 uncheck 試試看。
-- SSD 安裝果然非常快速..
uncheck Virtual Device,但是 Emulator 還是要安裝。
安裝過程很不順利,一直有 socket read timeout,然後跳過,先執行下一個。
然後Retry...
Android Studio 都完成後,VSCode,接上Pixel,Debug..
出現 Error
Warning: License for package Android SDK Platform 28 not accepted.
FAILURE: Build failed with an exception.
* What went wrong:
Could not determine the dependencies of task ':app:compileDebugJavaWithJavac'.
> Failed to install the following Android SDK packages as some licences have not been accepted.
build-tools;28.0.3 Android SDK Build-Tools 28.0.3
Run flutter doctor..
[!] Android toolchain - develop for Android devices (Android SDK version 29.0.3)
• Android SDK at C:\Users\user\AppData\Local\Android\sdk
• Platform android-29, build-tools 29.0.3
• Java binary at: C:\Android\Android Studio\jre\bin\java
• Java version OpenJDK Runtime Environment (build 1.8.0_212-release-1586-b04)
X Android licenses not accepted.
To resolve this, run: flutter doctor --android-licenses
所以 開啟Cmd,run flutter doctor -- android-licenses,所有 y/N 都回答 y,一堆...
完成後,再 run flutter doctor, 剩下一個 Error:
[!] Android Studio (version 3.6)
X Flutter plugin not installed; this adds Flutter specific functionality.
X Dart plugin not installed; this adds Dart specific functionality.
所以..Android Studio 還是要安裝 Flutter Plugin.....
Android Studio -- Plugins -- Market -- flutter (會一併安裝 Dart)
在run 一次 flutter doctor,no issue found !
VSCode 再 run 一次 debug,.在 debug output windows 看到 install xxxx 一堆,然後最後是 build \...\app-debug.apk,
之後,pixel2 上終於啟動了..
所以這個...用 VSCode 開發 Flutter App 的想法應該是失敗了,
因為最後 Android Studio,Flutter SDK 什麼的都安裝了,就是說,要在 Android Studio 可以開發 Flutter 的狀況下,VSCode 才能開發 Flutter.
因為最後 Android Studio,Flutter SDK 什麼的都安裝了,就是說,要在 Android Studio 可以開發 Flutter 的狀況下,VSCode 才能開發 Flutter.
沒有留言:
張貼留言