Which google jar files to compile when using these import

落爺英雄遲暮 提交于 2019-12-12 02:24:20

问题


First i was using

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

so i was getting an error message now i am using

compile 'com.google.android.gms:play-services-maps:9.0.2'
compile 'com.google.android.gms:play-services-auth:9.0.2'
compile 'com.google.android.gms:play-services-gcm:9.0.2'

But still these import file need some compile file to import these lib.

import com.google.android.gms.location.LocationRequest;
import com.google.android.gms.location.LocationServices;
import com.google.android.gms.plus.Plus;

回答1:


Add:

compile 'com.google.android.gms:play-services-location:9.0.2'
compile 'com.google.android.gms:play-services-plus:9.0.2'

The package name is (as far as I know) always the dependencie name as well. So com.google.android.gms.**location**.xyz is contained in com.google.android.gms:play-services-**location**:a.b.c.

Further you should update all 9.0.2 dependencies to the current 9.4.0:

compile 'com.google.android.gms:play-services-maps: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'
compile 'com.google.android.gms:play-services-location:9.4.0'
compile 'com.google.android.gms:play-services-plus:9.4.0'


来源:https://stackoverflow.com/questions/38941712/which-google-jar-files-to-compile-when-using-these-import

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!