mohesu / map_location_picker

Map location picker for flutter Based on google_maps_flutter
Apache License 2.0
46 stars 68 forks source link

Lost connection do device after "Error" #3

Closed DevTiago closed 2 years ago

DevTiago commented 2 years ago

Hello @rvndsngwn ,

I've been testing your package for a few days and i figure that sometimes, on Android, i lost the connection to device.

I choose the address, and after i click the arrow to deal with that data i have this on the console:

I/chatty  (16519): uid=10163(pt.******.app) androidmapsapi- identical 3 lines
I/Counters(16519): exceeded sample count in FrameTime
I/Counters(16519): exceeded sample count in FrameTime
E/AndroidRuntime(16519): FATAL EXCEPTION: GLThread 1157
E/AndroidRuntime(16519): Process: pt.******.app, PID: 16519
E/AndroidRuntime(16519): java.lang.NullPointerException: Attempt to get length of null array
E/AndroidRuntime(16519):    at java.nio.ByteBufferAsIntBuffer.put(ByteBufferAsIntBuffer.java:122)
E/AndroidRuntime(16519):    at com.google.maps.api.android.lib6.gmm6.vector.gl.buffer.n.i(:com.google.android.gms.dynamite_mapsdynamite@222413084@22.24.13 (150700-0):2)
E/AndroidRuntime(16519):    at com.google.maps.api.android.lib6.gmm6.vector.gl.buffer.n.d(:com.google.android.gms.dynamite_mapsdynamite@222413084@22.24.13 (150700-0):3)
E/AndroidRuntime(16519):    at com.google.maps.api.android.lib6.gmm6.vector.gl.drawable.d.s(:com.google.android.gms.dynamite_mapsdynamite@222413084@22.24.13 (150700-0):2)
E/AndroidRuntime(16519):    at com.google.maps.api.android.lib6.gmm6.vector.gl.drawable.ao.s(:com.google.android.gms.dynamite_mapsdynamite@222413084@22.24.13 (150700-0):12)
E/AndroidRuntime(16519):    at com.google.maps.api.android.lib6.gmm6.vector.bz.s(:com.google.android.gms.dynamite_mapsdynamite@222413084@22.24.13 (150700-0):29)
E/AndroidRuntime(16519):    at com.google.maps.api.android.lib6.gmm6.vector.bs.b(:com.google.android.gms.dynamite_mapsdynamite@222413084@22.24.13 (150700-0):151)
E/AndroidRuntime(16519):    at com.google.maps.api.android.lib6.gmm6.vector.an.run(:com.google.android.gms.dynamite_mapsdynamite@222413084@22.24.13 (150700-0):48)
E/flutter (16519): [ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: setState() called after dispose(): LocationPickerState#5a7cf(lifecycle state: defunct, not mounted)
E/flutter (16519): This error happens if you call setState() on a State object for a widget that no longer appears in the widget tree (e.g., whose parent widget no longer includes the widget in its build). This error can occur when code calls setState() from a timer or an animation callback.
E/flutter (16519): The preferred solution is to cancel the timer or stop listening to the animation in the dispose() callback. Another solution is to check the "mounted" property of this object before calling setState() to ensure the object is still in the tree.
E/flutter (16519): This error might indicate a memory leak if setState() is being called because another object is retaining a reference to this State object after it has been removed from the tree. To avoid memory leaks, consider breaking the reference to this object during dispose().
E/flutter (16519): #0      State.setState.<anonymous closure> (package:flutter/src/widgets/framework.dart:1078:9)
E/flutter (16519): #1      State.setState (package:flutter/src/widgets/framework.dart:1113:6)
E/flutter (16519): #2      LocationPickerState.searchPlace (package:map_location_picker/src/google_map_location_picker.dart:109:5)
E/flutter (16519): #3      LocationPickerState.build.<anonymous closure>.<anonymous closure> (package:map_location_picker/src/google_map_location_picker.dart:413:26)
E/flutter (16519): #4      SearchInputState.onSearchInputChange.<anonymous closure> (package:map_location_picker/src/search_input.dart:58:27)
E/flutter (16519): #5      Timer._createTimer.<anonymous closure> (dart:async-patch/timer_patch.dart:18:15)
E/flutter (16519): #6      _Timer._runTimers (dart:isolate-patch/timer_impl.dart:398:19)
E/flutter (16519): #7      _Timer._handleMessage (dart:isolate-patch/timer_impl.dart:429:5)
E/flutter (16519): #8      _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:192:12)
E/flutter (16519): 
E/flutter (16519): [ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: 'package:flutter/src/rendering/object.dart': Failed assertion: line 2461 pos 12: '!_debugDisposed': is not true.
E/flutter (16519): #0      _AssertionError._doThrowNew (dart:core-patch/errors_patch.dart:51:61)
E/flutter (16519): #1      _AssertionError._throwNew (dart:core-patch/errors_patch.dart:40:5)
E/flutter (16519): #2      RenderObject.markNeedsPaint (package:flutter/src/rendering/object.dart:2461:12)
E/flutter (16519): #3      RenderAndroidView._sizePlatformView (package:flutter/src/rendering/platform_view.dart:192:5)
E/flutter (16519): <asynchronous suspension>
E/flutter (16519): 
I/Process (16519): Sending signal. PID: 16519 SIG: 9
Lost connection to device.

And the app crashes.

That happens only sometimes but even in the production build.

rvndsngwn commented 2 years ago

Okay @DevTiago let me check…

stha-ums commented 2 years ago

having same problem Issue on Pixel 4am android 13 beta here is flutter doctor -v

[✓] Flutter (Channel stable, 3.0.3, on Linux Mint 20.3 5.4.0-121-generic, locale en_US.UTF-8)
    • Flutter version 3.0.3 at /home/umesh/snap/flutter/common/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 676cefaaff (2 weeks ago), 2022-06-22 11:34:49 -0700
    • Engine revision ffe7b86a1e
    • Dart version 2.17.5
    • DevTools version 2.12.2

[✓] Android toolchain - develop for Android devices (Android SDK version 33.0.0)
    • Android SDK at /home/umesh/Android/Sdk
    • Platform android-33, build-tools 33.0.0
    • Java binary at: /snap/android-studio/123/android-studio/jre/bin/java
    • Java version OpenJDK Runtime Environment (build 11.0.12+0-b1504.28-7817840)
    • All Android licenses accepted.

[✓] Chrome - develop for the web
    • CHROME_EXECUTABLE = /usr/bin/firefox

[✓] Linux toolchain - develop for Linux desktop
    • clang version 6.0.0-1ubuntu2 (tags/RELEASE_600/final)
    • cmake version 3.10.2
    • ninja version 1.8.2
    • pkg-config version 0.29.1

[✓] Android Studio (version 2021.2)
    • Android Studio at /snap/android-studio/123/android-studio
    • Flutter plugin version 68.1.2
    • Dart plugin version 212.5744
    • Java version OpenJDK Runtime Environment (build 11.0.12+0-b1504.28-7817840)

[✓] VS Code (version 1.68.1)
    • VS Code at /usr/share/code
    • Flutter extension version 3.44.0

[✓] Connected device (3 available)
    • Pixel 4a (mobile) • 11041JEC215369 • android-arm64  • Android 13 (API 33)
    • Linux (desktop)   • linux          • linux-x64      • Linux Mint 20.3 5.4.0-121-generic
    • Chrome (web)      • chrome         • web-javascript • Mozilla Firefox 102.0

[✓] HTTP Host Availability
    • All required HTTP hosts are available
rvndsngwn commented 2 years ago

work in progress

rvndsngwn commented 2 years ago