Android按需添加Google Play服务

之前不管使用何种Google Play服务,都是直接在gradle文件中引用一个库。android

compile 'com.google.android.gms:play-services:9.4.0'

这直接致使放法数超过了65535,后来发现从6.5版本之后是能够按需引用的,以下:ide

compile 'com.google.android.gms:play-services-ads:9.4.0'
compile 'com.google.android.gms:play-services-auth:9.4.0'
compile 'com.google.android.gms:play-services-gcm:9.4.0'

第一个是广告库,第二个是使用Google帐号登录用的受权库,第三个是Google Cloud相关库。这样应用程序会瘦身不少。gradle

各类库的详细列表在这里ui

相关文章
相关标签/搜索