Android 如何在nativescript插件seed中实现google play服务?

Android 如何在nativescript插件seed中实现google play服务?,android,typescript,plugins,google-api,nativescript,Android,Typescript,Plugins,Google Api,Nativescript,我正在使用推荐的nativescript插件种子为nativescript编写插件:。 对于我的插件,我需要使用谷歌定位服务,但我无法访问该服务 我在android文件夹中的include.gradle中实现了依赖项: 依赖关系{ 实现com.google.android.gms:play服务位置:17.0.0 } 然后我尝试使用myApp.android.ts中的服务,如下所示: 让client=com.google.android.gms.location.LocationServices;

我正在使用推荐的nativescript插件种子为nativescript编写插件:。 对于我的插件,我需要使用谷歌定位服务,但我无法访问该服务

我在android文件夹中的include.gradle中实现了依赖项:

依赖关系{ 实现com.google.android.gms:play服务位置:17.0.0 } 然后我尝试使用myApp.android.ts中的服务,如下所示:

让client=com.google.android.gms.location.LocationServices;
它总是告诉我“typeof android”上不存在属性“gms”,我不知道我缺少什么。

如果您只想获取位置,那么您可以在插件中添加插件作为依赖项,然后使用插件API获取位置

如果你喜欢一些定制,你可以直接在你的插件中实现你自己的版本

如果你想让你的插件公开使用,尽量不要在gradle文件中使用特定的版本

dependencies {
    def googlePlayServicesVersion = project.hasProperty('googlePlayServicesVersion') ? project.googlePlayServicesVersion : "11.4.0"
    compile "com.google.android.gms:play-services-location:$googlePlayServicesVersion"
}

我想为Geofence创建一个插件,所以我想使用Google Geofence服务。我将研究android实现以获得一些参考。