NativeScript / nativescript-geolocation

Geolocation plugin to use for getting current location, monitor movement, etc
Apache License 2.0
139 stars 76 forks source link

How to fix this error "Cannot enable the location service. Error: java.lang.NoClassDefFoundError: Failed resolution of: Lcom/google/android/gms/internal/zzbck" #249

Closed ArigarasuthanRepo closed 5 years ago

ArigarasuthanRepo commented 5 years ago

Iam developing android and ios application using nativescript-angular.Iam using the nativescrip-geo-location plugin to access the current location. iam also using nativescrip-plugin-firebase plugin in my app. I can't enable the location in android using nativescrip-geo-location in my app. How to fix the issue?

Iam using the plugin versions: nativescript-firebase = 7.3.0 geo-location = 5.1.0

This issue only occures on android platform,in ios it was worked. I also set the app.gradle properties like

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

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

} 
ArigarasuthanRepo commented 5 years ago

I have fixed the issue by adding befor-plugins.gradle file.Inside the before-plugins.gradle file like below.

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