NativeScript / nativescript-geolocation

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

JNI Exception when trying to enable location services #244

Closed andresilva-cc closed 4 years ago

andresilva-cc commented 4 years ago

Which platform(s) does your issue occur on?

Please, provide the following version numbers that your issue occurs with:

I found this on adb logcat:

JNI DETECTED ERROR IN APPLICATION: JNI NewStringUTF called with pending exception java.lang.NoClassDefFoundError: Failed resolution of: Lcom/google/android/gms/internal/zzbck;

Is there any code involved?

import * as geolocation from "nativescript-geolocation"
import { Accuracy } from "tns-core-modules/ui/enums"

export default {
  async mounted () {
    try {
      // Check if location is enabled
      const isEnabled = await geolocation.isEnabled()

      // If not enabled, ask for permission
      if (!isEnabled) {
        await geolocation.enableLocationRequest(true, true)

      // If enabled, start location watch
      } else {
        this.watchLocation()
      }

    } catch (ex) {
      console.log(ex)
    }
  },
andresilva-cc commented 4 years ago

Nevermind, I didn't see the end of the readme