【发布时间】:2016-09-21 23:49:32
【问题描述】:
我正在尝试使用 google play 服务位置 API。 我已经从 sdk manager 安装了 Google Repositories。
我正在使用 Eclipse 并导入我去过的位置 jar: path_to_sdk/extras/google/m2repository/com/google/android/gms/play-services-location/9.0.0
我已经解压了 aar 文件并将 classes.jar 文件添加到我项目的 libs 文件夹中。并且还包括作为项目的库。
添加代码后:
public class ListenerService extends Service {
public void onCreate() {
mGoogleApiClient = new GoogleApiClient.Builder(this)
.addConnectionCallbacks(this)
.addOnConnectionFailedListener(this)
.addApi(LocationServices.API)
.build();
}
}
我在 eclipse 中得到这个错误:
The type com.google.android.gms.common.api.Api$zzf cannot be resolved. It is indirectly referenced from required .class files
我做错了什么?我错过了什么?
【问题讨论】:
-
显示更多代码,以便我们获得更好的想法。当它应该使用上下文时,它可能在匿名类中时看起来你正在使用它
-
我修改了代码示例。
标签: android eclipse google-play-services