Nativescript “如何修复此错误”;无法启用位置服务。错误:java.lang.NoClassDefFoundError“;?

Nativescript “如何修复此错误”;无法启用位置服务。错误:java.lang.NoClassDefFoundError“;?,nativescript,nativescript-angular,Nativescript,Nativescript Angular,我正在使用本机脚本开发android和ios应用程序。我正在使用本机脚本地理位置插件访问当前位置。我还在我的应用程序中使用原生脚本插件firebase插件。我无法在我的应用程序中使用本机脚本geolocation在android中启用位置。如何解决这个问题 Iam使用插件版本: nativescript firebase=7.3.0 地理位置=5.1.0 这个问题只发生在android平台上,在ios中,它是有效的。我还将app.gradle属性设置为 android { default

我正在使用本机脚本开发android和ios应用程序。我正在使用本机脚本地理位置插件访问当前位置。我还在我的应用程序中使用原生脚本插件firebase插件。我无法在我的应用程序中使用本机脚本geolocation在android中启用位置。如何解决这个问题

Iam使用插件版本: nativescript firebase=7.3.0 地理位置=5.1.0

这个问题只发生在android平台上,在ios中,它是有效的。我还将app.gradle属性设置为

android {  
  defaultConfig {
    applicationId = "id"  
    multiDexEnabled true
    generatedDensities = []
  }
  project.ext {
    googlePlayServicesVersion = "16.+"
    }

  aaptOptions {  
    additionalParameters "--no-version-vectors"  
  }
  dexOptions {
    javaMaxHeapSize "4g"
  }

} 
Iam收到以下错误:

Cannot enable the location service. Error: java.lang.NoClassDefFoundError: Failed resolution of: Lcom/google/android/gms/internal/zzbck;

感谢manoj推荐此链接。我已经通过在android sdk中更新google play服务解决了这个问题,并且我还添加了before-plugins.gradle文件,并添加了google play服务配置,如下所示

android {  
  project.ext {
      googlePlayServicesVersion = "15.0.1"
  }
} 

对不起,请您详细说明一下,当您调用位置服务时是否会出现运行时异常?Firebase插件v7.3.0非常旧,您使用的是哪个版本的tns运行时?是的,我在启用location Services时遇到运行时异常tns运行时意味着什么android运行时?是的,这就是我所要求的。在app.gradle中尝试
15.0.1
,如果问题仍然存在,请在plugins.gradle之前尝试
,如相关文章中所述。