首页 > 解决方案 > 看不到 Nearby.ExposureNotification 包

问题描述

我已将附近的包添加到 build.gradle (module:app) 中,如下所示:

implementation 'com.google.android.gms:play-services-nearby'

但是,我试图在我的应用程序中导入以下包,但我看不到它:

com.google.android.gms.nearby.exposurenotification

这是 google develoepr 上的包链接: https ://developers.google.com/android/reference/com/google/android/gms/nearby/exposurenotification/package-summary

如果你通过谷歌查看这个 repo,你可以看到他们正在使用这个包: https ://github.com/google/exposure-notifications-android 我探索了他们项目中的 near.Nearby 类,你可以看到这个类有一个方法叫做:

ExposureNotificationClient getExposureNotificationClient(Context c)

我在我的应用程序的 Nearby 类中也没有看到

我正在实施附近软件包的最后一个版本,即17.0.0

标签: javaandroid

解决方案


从 gradle 实现它时,你不会看到这个包。因为这个包是一个 EAP(“抢先体验计划”)。因此,您可以从以下链接复制此库并将其粘贴到您的应用程序: https ://github.com/google/exposure-notifications-android/tree/master/app/libs

另外,请查看此问题以获取更多信息: https ://github.com/google/exposure-notifications-android/issues/23


推荐阅读