Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Start tracking causes rebuild of MyApp in example #68

Open
rasuldev opened this issue Nov 20, 2023 · 4 comments
Open

Start tracking causes rebuild of MyApp in example #68

rasuldev opened this issue Nov 20, 2023 · 4 comments

Comments

@rasuldev
Copy link

I've removed from the example all code that changes a screen (see https://github.com/rasuldev/bg-location-tracker-test/). When I start tracking, there are no changes on the screen but I get rebuild every 4 second. Why does this happen and how can I avoid repeatable rebuilding?

изображение

LOGS:

[log] BUILD
I/flutter (12565): locationUpdate: {lat: 37.4219983, lon: -122.084, alt: 5.0, vertical_accuracy: 0.4020833373069763, horizontal_accuracy: 5.0, course: -1.0, course_accuracy: -1.0, speed: 0.0, speed_accuracy: 0.5, logging_enabled: true}
D/EGL_emulation(12565): app_time_stats: avg=2025.91ms min=2025.91ms max=2025.91ms count=1
D/LocationUpdatesService(12565): New location: Location[fused 37.421998,-122.084000 hAcc=5.0 et=+2h2m14s655ms alt=5.0 vAcc=0.40208334 vel=0.0 sAcc=0.5]
D/BackgroundManager(12565): Location: 37.4219983: -122.084
D/BackgroundManager(12565): Creating new engine
D/EGL_emulation(12565): eglCreateContext: 0x7cb27904cd90: maj 3 min 1 rcv 4
D/EGL_emulation(12565): eglCreateContext: 0x7cb27904c010: maj 3 min 1 rcv 4
D/HostConnection(12565): HostComposition ext ANDROID_EMU_CHECKSUM_HELPER_v1 ANDROID_EMU_native_sync_v2 ANDROID_EMU_native_sync_v3 ANDROID_EMU_native_sync_v4 ANDROID_EMU_dma_v1 ANDROID_EMU_direct_mem ANDROID_EMU_host_composition_v1 ANDROID_EMU_host_composition_v2 ANDROID_EMU_YUV_Cache ANDROID_EMU_has_shared_slots_host_memory_allocator ANDROID_EMU_sync_buffer_data ANDROID_EMU_read_color_buffer_dma ANDROID_EMU_hwc_multi_configs GL_OES_EGL_image_external_essl3 GL_OES_vertex_array_object GL_KHR_texture_compression_astc_ldr ANDROID_EMU_host_side_tracing ANDROID_EMU_gles_max_version_3_1
D/EGL_emulation(12565): eglMakeCurrent: 0x7cb27904c010: ver 3 1 (tinfo 0x7cb49be61300) (first time)
I/flutter (12565): locationUpdate: {lat: 37.4219983, lon: -122.084, alt: 5.0, vertical_accuracy: 0.4020833373069763, horizontal_accuracy: 5.0, course: -1.0, course_accuracy: -1.0, speed: 0.0, speed_accuracy: 0.5, logging_enabled: true}
D/BackgroundManager(12565): Got success, destroy engine!
[log] BUILD
D/EGL_emulation(12565): app_time_stats: avg=2085.58ms min=2085.58ms max=2085.58ms count=1
D/LocationUpdatesService(12565): New location: Location[fused 37.421998,-122.084000 hAcc=5.0 et=+2h2m16s652ms alt=5.0 vAcc=0.40208334 vel=0.0 sAcc=0.5]
D/BackgroundManager(12565): Location: 37.4219983: -122.084
D/BackgroundManager(12565): Creating new engine
D/EGL_emulation(12565): eglCreateContext: 0x7cb27904d750: maj 3 min 1 rcv 4
D/EGL_emulation(12565): eglCreateContext: 0x7cb27903fb90: maj 3 min 1 rcv 4
D/HostConnection(12565): HostComposition ext ANDROID_EMU_CHECKSUM_HELPER_v1 ANDROID_EMU_native_sync_v2 ANDROID_EMU_native_sync_v3 ANDROID_EMU_native_sync_v4 ANDROID_EMU_dma_v1 ANDROID_EMU_direct_mem ANDROID_EMU_host_composition_v1 ANDROID_EMU_host_composition_v2 ANDROID_EMU_YUV_Cache ANDROID_EMU_has_shared_slots_host_memory_allocator ANDROID_EMU_sync_buffer_data ANDROID_EMU_read_color_buffer_dma ANDROID_EMU_hwc_multi_configs GL_OES_EGL_image_external_essl3 GL_OES_vertex_array_object GL_KHR_texture_compression_astc_ldr ANDROID_EMU_host_side_tracing ANDROID_EMU_gles_max_version_3_1
D/EGL_emulation(12565): eglMakeCurrent: 0x7cb27903fb90: ver 3 1 (tinfo 0x7cb49be61300) (first time)
[log] BUILD
...

@vanlooverenkoen
Copy link
Contributor

I tested your repository and I am not getting rebuilds. This is my log

[log] BUILD
-----> Here starts a new location update
D/LocationUpdatesService(23571): New location: Location[fused 51.226111,4.420338 hAcc=12.061 et=+23h58m22s273ms alt=55.400001525878906 vAcc=1.0]
D/BackgroundManager(23571): Location: 51.2261112: 4.4203377
D/BackgroundManager(23571): Creating new engine
W/FlutterJNI(23571): FlutterJNI.loadLibrary called more than once
W/FlutterJNI(23571): FlutterJNI.prefetchDefaultFontManager called more than once
I/ResourceExtractor(23571): Found extracted resources res_timestamp-1-1716877539526
W/FlutterJNI(23571): FlutterJNI.init called more than once
I/flutter (23571): locationUpdate: {lat: 51.2261112, lon: 4.4203377, alt: 55.400001525878906, vertical_accuracy: 1.0, horizontal_accuracy: 12.060999870300293, course: -1.0, course_accuracy: 45.0, speed: -1.0, speed_accuracy: 1.5, logging_enabled: true}
D/BackgroundManager(23571): Got success, destroy engine!

D/LocationUpdatesService(23571): New location: Location[fused 51.226119,4.420335 hAcc=12.925 et=+23h58m33s673ms alt=55.30000305175781 vAcc=0.9583333 vel=0.06471249 sAcc=1.5]
D/BackgroundManager(23571): Location: 51.2261192: 4.4203354
D/BackgroundManager(23571): Creating new engine
I/flutter (23571): locationUpdate: {lat: 51.2261192, lon: 4.4203354, alt: 55.30000305175781, vertical_accuracy: 0.9583333134651184, horizontal_accuracy: 12.925000190734863, course: -1.0, course_accuracy: -1.0, speed: 0.06471248716115952, speed_accuracy: 1.5, logging_enabled: true}
D/BackgroundManager(23571): Got success, destroy engine!
-----> Here starts a new location update
D/LocationUpdatesService(23571): New location: Location[fused 51.226109,4.420335 hAcc=12.683 et=+23h58m43s857ms alt=55.400001525878906 vAcc=0.95416665 vel=0.11116707 sAcc=1.5 bear=180.90303 bAcc=45.0]
D/BackgroundManager(23571): Location: 51.2261088: 4.4203352
D/BackgroundManager(23571): Creating new engine
I/flutter (23571): locationUpdate: {lat: 51.2261088, lon: 4.4203352, alt: 55.400001525878906, vertical_accuracy: 0.9541666507720947, horizontal_accuracy: 12.682999610900879, course: 180.9030303955078, course_accuracy: 45.0, speed: 0.1111670732498169, speed_accuracy: 1.5, logging_enabled: true}
D/BackgroundManager(23571): Got success, destroy engine!

3 location updates that are triggered without a rebuild. I kept this running for a couple minutes, and I saw no refreshes

@vanlooverenkoen
Copy link
Contributor

@rasuldev can you do a Flutter doctor -v to see which versions you are using.
I am on 3.19.6 without issues.

@vanlooverenkoen
Copy link
Contributor

fluttercommunity/flutter_workmanager#522 seems highly related.

@vanlooverenkoen
Copy link
Contributor

@rasuldev you are using android studio. Can you test with visual studio code? Or can you tests by running flutter run in the terminal. Do you in that case still have the same issue? Because we think it is related to an android studio issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants