2014/12/09

Google Play services 6.5: Selectively compiling APIs

Google Play services 升上 6.5 之後,其中一個特色就是多了阿文的次元切割功能,現在終於可以不用將整包 Google Play services 納入只為了使用其中幾種 API。舉例來說,之前為了支援 GCM 跟 Cast,我必須在 build.gradle 寫入:

現在我可以選擇性的只加入我需要的:

這樣就可以有效避免 method 數量超過 65,536 個上限的問題。

Reference:
http://android-developers.blogspot.tw/2014/11/google-play-services-65.html
http://developer.android.com/google/play-services/setup.html