Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/326.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java 安卓类';GeofencingClient&x27;不';不存在?_Java_Android_Geofencing - Fatal编程技术网

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'
   //...
}