londonappbrewery / Clima-Flutter

Starter code for the Clima Project from the Complete Flutter Development Bootcamp
https://www.appbrewery.co
155 stars 740 forks source link

Geolocator Crashing #4

Open bpncodes opened 5 years ago

bpncodes commented 5 years ago

I have tried searching about this issue extensively but I could not find an answer. My Clima App refuses to give me the geolocation. The geolocator package does not seem to work. I am really confused about this.

The error I get is :

I/art ( 6109): at void android.os.MessageQueue.nativePollOnce(long, int) (MessageQueue.java:-2) I/art ( 6109): at android.os.Message android.os.MessageQueue.next() (MessageQueue.java:328) I/art ( 6109): at void android.os.Looper.loop() (Looper.java:148) I/art ( 6109): at void android.app.ActivityThread.main(java.lang.String[]) (ActivityThread.java:6251) I/art ( 6109): at java.lang.Object java.lang.reflect.Method.invoke!(java.lang.Object, java.lang.Object[]) (Method.java:-2) I/art ( 6109): at void com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run() (ZygoteInit.java:1075) I/art ( 6109): at void com.android.internal.os.ZygoteInit.main(java.lang.String[]) (ZygoteInit.java:936) I/art ( 6109): E/flutter ( 6109): [ERROR:flutter/shell/platform/android/platform_view_android_jni.cc(39)] java.lang.NoClassDefFoundError: Failed resolution of: Landroid/support/v4/util/ArraySet; E/flutter ( 6109): at com.google.android.gms.common.api.internal.GoogleApiManager.(Unknown Source) E/flutter ( 6109): at com.google.android.gms.common.api.internal.GoogleApiManager.zab(Unknown Source) E/flutter ( 6109): at com.google.android.gms.common.api.GoogleApi.(Unknown Source) E/flutter ( 6109): at com.google.android.gms.common.api.GoogleApi.(Unknown Source) E/flutter ( 6109): at com.google.android.gms.location.FusedLocationProviderClient.(Unknown Source) E/flutter ( 6109): at com.google.android.gms.location.LocationServices.getFusedLocationProviderClient(Unknown Source) E/flutter ( 6109): at com.baseflow.geolocator.tasks.LocationUpdatesUsingLocationServicesTask.(LocationUpdatesUsingLocationServicesTask.java:29) E/flutter ( 6109): at com.baseflow.geolocator.tasks.TaskFactory.createCurrentLocationTask(TaskFactory.java:44) E/flutter ( 6109): at com.baseflow.geolocator.GeolocatorPlugin.onMethodCall(GeolocatorPlugin.java:66) E/flutter ( 6109): at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler.onMessage(MethodChannel.java:222) E/flutter ( 6109): at io.flutter.embedding.engine.dart.DartMessenger.handleMessageFromDart(DartMessenger.java:96) E/flutter ( 6109): at io.flutter.embedding.engine.FlutterJNI.handlePlatformMessage(FlutterJNI.java:656) E/flutter ( 6109): at android.os.MessageQueue.nativePollOnce(Native Method) E/flutter ( 6109): at android.os.MessageQueue.next(MessageQueue.java:328) E/flutter ( 6109): at android.os.Looper.loop(Looper.java:148) E/flutter ( 6109): at android.app.ActivityThread.main(ActivityThread.java:6251) E/flutter ( 6109): at java.lang.reflect.Method.invoke(Native Method) E/flutter ( 6109): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1075) E/flutter ( 6109): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:936) E/flutter ( 6109): Caused by: java.lang.ClassNotFoundException: Didn't find class "android.support.v4.util.ArraySet" on path: DexPathList[[zip file "/data/app/com.example.geol-1/base.apk"],nativeLibraryDirectories=[/data/app/com.example.geol-1/lib/arm, /data/app/com.example.geol-1/base.apk!/lib/armeabi-v7a, /system/lib, /vendor/lib, /system/vendor/lib]] E/flutter ( 6109): at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56) E/flutter ( 6109): at java.lang.ClassLoader.loadClass(ClassLoader.java:380) E/flutter ( 6109): at java.lang.ClassLoader.loadClass(ClassLoader.java:312) E/flutter ( 6109): ... 19 more E/flutter ( 6109): F/flutter ( 6109): [FATAL:flutter/shell/platform/android/platform_view_android_jni.cc(76)] Check failed: CheckException(env). F/libc ( 6109): Fatal signal 6 (SIGABRT), code -6 in tid 6109 (om.example.geol) Lost connection to device. Exited (sigterm) Screenshot (45)

KaoutharMokrane commented 5 years ago

I'm having the same problem. No errors at all but no position is printed.

yhfa commented 4 years ago

I'm having the same problem. No errors at all but no position is printed.

hello bro , did you solve it ?

bpncodes commented 4 years ago

No solutions yet try improvising the code

pdxalz commented 4 years ago

I'm having the same problem. No errors at all but no position is printed.

I was having this issue too using an Android simulator running on Windows 10. I was able to get it to work by using LocationAccuracy.high instead of LocationAccuracy.low. Medium, Low and Lowest do not work for me.

anuljain23 commented 4 years ago

I'm having the same problem. No errors at all but no position is printed.

I was having this issue too using an Android simulator running on Windows 10. I was able to get it to work by using LocationAccuracy.high instead of LocationAccuracy.low. Medium, Low and Lowest do not work for me.

This was very helpful. It solved my problem too. Thank you very much!!!

pdxalz commented 4 years ago

This was very helpful. It solved my problem too. Thank you very much!!! I tried investigating further, but "low" started working. After wiping the data on the emulator, the problem reoccurred, but just doing a hot reload got it working again. When I first saw the problem it didn't seem like there was such an easy fix. I also tried in on a real Nexus 7 tablet, and it works fine.

ajithsimon commented 4 years ago

location is printing when I use android emulator, its not happening with iOS simulator. Any Idea guys??

dryusha commented 4 years ago

location is printing when I use android emulator, its not happening with iOS simulator. Any Idea guys??

Had same issue. but i find the solution for me. At iOS simulator Feature -> Location -> and pick one of, except None.. for me work with Custom Location..