MustansirZia / react-native-fused-location

Finest location for react-native on Android using the new Fused API.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

java.lang.NoSuchMethodError

huangkaiw3n opened this issue · comments

Thanks for the awesome library @MustansirZia

It's been working great for me so far but I've received a single crash log with the following details:
User Device: Optimus F5
Android Version: 4.1

java.lang.NoSuchMethodError: android.location.Location.isFromMockProvider at com.mustansirzia.fused.FusedLocationModule.convertLocationToJSON(FusedLocationModule.java:207) at com.mustansirzia.fused.FusedLocationModule.access$000(FusedLocationModule.java:31) at com.mustansirzia.fused.FusedLocationModule$1.onLocationChanged(FusedLocationModule.java:120) at com.google.android.gms.internal.zzasg$zzb$1.zza(Unknown Source) at com.google.android.gms.internal.zzasg$zzb$1.zzs(Unknown Source) at com.google.android.gms.internal.zzabh.zzb(Unknown Source) at com.google.android.gms.internal.zzabh$zza.handleMessage(Unknown Source) at android.os.Handler.dispatchMessage(Handler.java:99) at android.os.Looper.loop(Looper.java:137) at com.facebook.react.bridge.queue.MessageQueueThreadImpl$3.run(MessageQueueThreadImpl.java:208) at java.lang.Thread.run(Thread.java:856)

Is this a compatibility issue with Android 4?

@huangkaiw3n You're welcome!
Yes, indeed. isFromMockProvider is not available below SDK version 18. (4.3). Here's a Reference.
This issue is now fixed in 8192bb3. Update your version to 0.0.9. This exception should now go away as I'm using a different method now to check mock locations below SDK 18.
Thank you so much for pointing this out.