Java 安卓类';GeofencingClient&x27;不';不存在?
我正试图遵循,但当我试图声明Java 安卓类';GeofencingClient&x27;不';不存在?,java,android,geofencing,Java,Android,Geofencing,我正试图遵循,但当我试图声明GeofencingClient变量时,我立即陷入困境: 通常,我可以只按Alt+Enter并选择“导入类”,但此选项在此处不可用: GeofencingClient类是否已存在?我需要安装一些第三方库吗?添加导入com.google.android.gms.location.GeofencingClient 这取决于: 是谷歌Play服务的一部分。您需要将以下依赖项添加到模块的build.gradle文件中,然后才能在代码中导入该类: dependencies
GeofencingClient
变量时,我立即陷入困境:
通常,我可以只按Alt+Enter并选择“导入类”,但此选项在此处不可用:
GeofencingClient
类是否已存在?我需要安装一些第三方库吗?添加导入com.google.android.gms.location.GeofencingClient
这取决于:
是谷歌Play服务的一部分。您需要将以下依赖项添加到模块的build.gradle文件中,然后才能在代码中导入该类:
dependencies {
// ...
implementation 'com.google.android.gms:play-services-location:17.0.0'
//...
}
dependencies {
// ...
implementation 'com.google.android.gms:play-services-location:17.0.0'
//...
}