顯示具有 03-1.Flutter 標籤的文章。 顯示所有文章
顯示具有 03-1.Flutter 標籤的文章。 顯示所有文章

2020年10月13日 星期二

Flutter建置日記2

 對話紀錄

I was also tackling the same issue for an entire day. I searched on StackOverflow, GitHub, Medium and other sites to find the solution to this problem but the thing that worked for me was uninstalling Java JDK version 14 and reinstalling JDK version 8.
I don't want anyone to go through the same issue so I'm posting the detailed solution that worked for me.

When I executed the flutter doctor command in my CMD, the doctor showed me these summaries.


I tried to run flutter doctor --android-licenses and sdkmanager --licenses to accept the license agreement but after executing both threw the same exception.


I also tried to revert back my Java installation but that created a total mess for me.

These are the Android Studio SDKs that I've installed. I've read in many articles and threads that API level 29 Android 10.0 (Q) must be installed so I downloaded it and the physical device I've connected to is running Android 9 (Pie) so I've downloaded that as well.


I've downloaded and installed these SDK tools.


After that, I've uninstalled my Java JDK version 14 installation and installed JDK version 8 and set the JAVA_HOME and PATH environmental variables and restarted my PC.
By doing so the flutter doctor showed these summaries.


After running flutter doctor --android-licenses it showed these summaries.


All these steps worked for me.




Share:

Flutter 建置日記

 Flutter 建置日記

這次所使用的是高科校務通放在Github的檔案,開放讓開發者能夠提供修正參考的管道,這兩天我的電腦發生新建Flutter專案時會導致專案無法建立,跑了一個小時還沒跑完。
索性去讓Android Studio(以下簡稱AS)重新建立Flutter子資料夾,發現它安裝的檔案許多是flutter.dev上面未提供的,因此,直接讓軟體幫我重新設定是最快的方式,期間大概只花了幾分鐘,搞定之後,只要幾秒鐘就可以快速新建一個新專案。
1. 首先,我需要的軟體有AS,並且需要有Flutter相關的先備知識(它是一個能夠支援小綠人跟咬一口雙平台的套件)
2. 再來,進入AS的初始畫面後,在右下角齒輪(Configure)中打開Settings/Plugins,並且安裝Flutter跟Dart兩個套件。
3. 回到主畫面後,點選建立Flutter專案。
4. 接下來是最麻煩也是最需要耐心的部分,就是它需要抓到你放Flutter套件的資料夾,這邊建議不要用網頁上下載下來解壓縮的,在新增檔案時直接建立在C磁碟機或你想要的位置即可。
5. 在這裡,我預設建立的版本是Flutter Application,
6. 依序輸入Project Name、Flutter SDK Path、Project Location、Description等資訊
其中,Flutter SDK Path如果之前您都沒有安裝過的話,它右邊有一個Install的按鈕,就直接按下去,他會幫您下載您需要的所有套件包,以上幾項確定沒有問題之後就可以繼續下一步驟,之後如需重複建立專案,只需重新指向這個已經建立好的套件包就好。
7. Enjoy editing your project!!
到此,導覽告一段落
因部落格尚未建立,所以先貼文在這邊。給有興趣的夥伴參考。
By the way,如果之後想要將軟體回復到初始值的話,只需刪除兩個資料夾即可,如下:
1.刪​​除c盤下的設定檔,路徑為C:\Users \用戶名\ .AndroidStudioX.X和C:\ Users \用戶名\ .android兩個資料夾
2.重新打開Android Studio
Share: