Tuesday, January 19, 2016

Migrate MyLocation (IAmHere) project to Android Studio 1.5.1

MyLocation (IAmHere)

最初個 project 叫左 MyLocation, 後尾同佢改左個人性化D既名 IAmHere, 不過個 project 無變, 仲係 MyLocation.

呢部份算係簡單少少, 因為只係接收 SMS, 讀取 GPS 再回傳, 唔需要開地圖, 唔駛攪 Google Maps API d 野.


(1) SDK Path changed.  
呢個小事, 佢會自動修正.  我準備以後都係裝落 C:\Android\SDK , 希望下次唔駛再 prompt.

(之後可能會問 proxy setting, 自動執正佢就算了)


(2) Failed to find Build Tools revision 20.0.0


由於之前係 20.0.0, 家陣係 23.0.2, build tools 既 version 唔會有大影響, 安全起建, 有新用新都得.
除非你轉用新 version 有問題, 否則, 無謂叫佢裝番個舊版了.

開番 app\build.gradle 改左佢就得了:


如果唔係用 project view, 用 Android view 既話, 開 Gradle Scripts 下面既 build.gradle (Module: app) 都係一樣既:



將佢改成 compileSdkVersion 23 同埋 buildToolsVersion "23.0.2", 之後 Click 右上既 "Try Again" 再試.



(3) The project is using an unsupported version of the Android Grade plug-in (0.13.0).  The recommended version is 1.5.0


呢度叫佢自己改番正就得了, 直接 click "Fix plugin version and sync project".
佢就會自動 fix 然後再 build 個 project....

當然, 又會再碰到到另一個問題:

(4) Gradle DSL method not found: 'runProguard()'

呢個問題, 在 Stackoverflow 有講 ( Stackoverflow 有關既帖  相關改動既資料 )
好簡單, 開番 app\build.gradle, 將 runProguard 改成 minifyEnabled 再 "Try Again" 就得了.


之後 MyLocation 應該可以用得了.

No comments:

Post a Comment