BirjuVachhani/locus-android

Unable to get current location

Damercy opened this issue · 1 comments

Bug
App crashes when initializing Locus for getting current location in a fragment

To Reproduce
Steps to reproduce the behavior:

  1. Initialize locus to get current location
 Locus.getCurrentLocation(requireContext()) { locusResult: LocusResult ->
    // Your task
}
  1. Open the fragment that gets the current location using above api
  2. App crashes

Expected behavior
Get current location

Device info:

  • Device: Lenovo K10 Note
  • OS: Android
  • Version: Pie (API 28)

Additional context
Here's the error:

java.lang.NoClassDefFoundError: Failed resolution of: Lcom/google/android/gms/location/LocationRequest;
        at com.birjuvachhani.locus.ConfigurationKt.getDefaultRequest(Configuration.kt:68)
        at com.birjuvachhani.locus.Configuration.<init>(Configuration.kt:41)
        at com.birjuvachhani.locus.Locus.<clinit>(Locus.kt:84)

Last few lines:

Caused by: java.lang.ClassNotFoundException: Didn't find class "com.google.android.gms.location.LocationRequest" on path: DexPathList[[zip file "/data/app/ai.microfinance.lyt-d39yxfzmfFCl5laJw1nNXg==/base.apk"],nativeLibraryDirectories=[/data/app/ai.microfinance.lyt-d39yxfzmfFCl5laJw1nNXg==/lib/arm64, /system/lib64]]
        at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:134)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:379)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:312)

Duplicate of #39