-
Notifications
You must be signed in to change notification settings - Fork 26.7k
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
IntegrationTestWidgetsFlutterBinding takeScreenshot gets stuck for GoogleMaps #127306
Comments
@wonderingdev |
@darshankawar Thank you for your response. I've already followed these steps. I think I've tried every possible way I could think of and went through multiple info sources. Nothing worked specifically in the case of GoogleMaps. The test just gets stuck at the |
Thanks for the update @wonderingdev
|
@darshankawar Thank you. Here's how I've tested it by adapting the above Steps to Reproduce:
The LogsResolving dependencies...
collection 1.17.1 (1.17.2 available)
espresso 0.2.1 (0.3.0+5 available)
file 6.1.4 (7.0.0 available)
google_maps_flutter_android 2.4.14 (2.4.15 available)
google_maps_flutter_ios 2.2.1 (2.2.3 available)
google_maps_flutter_platform_interface 2.2.6 (2.2.7 available)
matcher 0.12.15 (0.12.16 available)
material_color_utilities 0.2.0 (0.5.0 available)
source_span 1.9.1 (1.10.0 available)
test_api 0.5.1 (0.6.0 available)
vm_service 11.3.0 (11.6.0 available)
Got dependencies!
Running Gradle task 'assembleDebug'... 2,664ms
✓ Built build/app/outputs/flutter-apk/app-debug.apk.
Installing build/app/outputs/flutter-apk/app-debug.apk... 1,243ms
D/EGL_emulation(15622): eglCreateContext: 0x7bd90e0a90: maj 3 min 0 rcv 3
I/oglemapsexample(15622): Compiler allocated 4579KB to compile void android.view.ViewRootImpl.performTraversals()
I/flutter (15622): 00:00 +0: testCompassToggle
W/Parcel (15622): Expecting binder but got null!
D/MapsInitializer(15622): preferredRenderer: LATEST
D/zzcb (15622): preferredRenderer: LATEST
I/zzcb (15622): Making Creator dynamically
W/ziparchive(15622): Unable to open '/data/user_de/0/com.google.android.gms/app_chimera/m/00000010/DynamiteLoader.dm': No such file or directory
W/ziparchive(15622): Unable to open '/data/user_de/0/com.google.android.gms/app_chimera/m/00000010/DynamiteLoader.dm': No such file or directory
I/DynamiteModule(15622): Considering local module com.google.android.gms.maps_core_dynamite:0 and remote module com.google.android.gms.maps_core_dynamite:231112103
I/DynamiteModule(15622): Selected remote version of com.google.android.gms.maps_core_dynamite, version >= 231112103
V/DynamiteModule(15622): Dynamite loader version >= 2, using loadModule2NoCrashUtils
W/System (15622): ClassLoader referenced unknown path:
D/nativeloader(15622): Configuring classloader-namespace for other apk . target_sdk_version=33, uses_libraries=, library_path=/data/app/~~I3APe4NP91loXAOgt1o7IA==/com.google.android.gms-2WaZrNvnGZ2xvivVCRTM9A==/lib/arm64:/data/app/~~I3APe4NP91loXAOgt1o7IA==/com.google.android.gms-2WaZrNvnGZ2xvivVCRTM9A==/base.apk!/lib/arm64-v8a, permitted_path=/data:/mnt/expand:/data/user/0/com.google.android.gms
W/ziparchive(15622): Unable to open '/data/user_de/0/com.google.android.gms/app_chimera/m/00000016/dl-MapsCoreDynamite.integ_231112103100400.dm': No such file or directory
W/ziparchive(15622): Unable to open '/data/user_de/0/com.google.android.gms/app_chimera/m/00000016/dl-MapsCoreDynamite.integ_231112103100400.dm': No such file or directory
I/Google Android Maps SDK(15622): Google Play services client version: 12451000
I/Google Android Maps SDK(15622): Google Play services package version: 231613044
I/Google Android Maps SDK(15622): Google Play services maps renderer version(maps_core): 231112103
D/CompatibilityChangeReporter(15622): Compat change id reported: 183155436; UID 10197; state: DISABLED
I/SnapshotHandler(15622): Unable to retrieve flag snapshot for com.google.android.gms.maps#io.flutter.plugins.googlemapsexample, using defaults.
D/EGL_emulation(15622): app_time_stats: avg=18.87ms min=2.11ms max=356.67ms count=40
D/MapsInitializer(15622): loadedRenderer: LATEST
D/MapsInitializer(15622): preferredRenderer: null
D/zzcb (15622): preferredRenderer: null
I/Google Android Maps SDK(15622): Google Play services package version: 231613044
I/Google Android Maps SDK(15622): Google Play services maps renderer version(maps_core): 231112103
D/CompatibilityChangeReporter(15622): Compat change id reported: 210923482; UID 10197; state: DISABLED
D/CompatibilityChangeReporter(15622): Compat change id reported: 37756858; UID 10197; state: ENABLED
D/CompatibilityChangeReporter(15622): Compat change id reported: 171228096; UID 10197; state: ENABLED
W/oglemapsexample(15622): Accessing hidden method Ldalvik/system/VMStack;->getStackClass2()Ljava/lang/Class; (unsupported, reflection, allowed)
I/NativeHelper(15622): NativeHelper.setContext(androidx.multidex.MultiDexApplication@4f13097) on thread main
I/btx (15622): Starting UI_THREAD
I/but (15622): getExecutor UI_THREAD CREATED Thread[main,5,main]
I/but (15622): getExecutor BACKGROUND_THREADPOOL CREATED bus@34e7279[Running, pool size = 0, active threads = 0, queued tasks = 0, completed tasks = 0]
I/NativeHelper(15622): NativeHelper.ensureLibraryLoaded on thread androidmapsapi-DefaultPool2
I/NativeHelper(15622): About to load JNI library on thread androidmapsapi-DefaultPool2
W/NativeHelper(15622): safeLoadLibrary: gmm-jni
D/nativeloader(15622): Configuring classloader-namespace for other apk . target_sdk_version=28, uses_libraries=ALL, library_path=/data/user_de/0/com.google.android.gms/app_chimera/m/00000016/dl-MapsCoreDynamite.integ_231112103100400.apk!/lib/arm64-v8a, permitted_path=/data:/mnt/expand
I/native (15622): I0000 00:00:1684833051.453436 15736 jni_init.cc:8] Initializing JNI...
I/NativeHelper(15622): Initializing JNI.
I/NativeHelper(15622): JNI initialized.
I/but (15622): getExecutor LIGHTWEIGHT_THREADPOOL CREATED bus@3f2a06e[Running, pool size = 0, active threads = 0, queued tasks = 0, completed tasks = 0]
I/bgx (15622): No cached client parameters found
I/but (15622): getExecutor TILE_PREP_THREADPOOL CREATED bus@8cf01a0[Running, pool size = 0, active threads = 0, queued tasks = 0, completed tasks = 0]
I/but (15622): getExecutor GMM_PICKER CREATED bus@efe011e[Running, pool size = 0, active threads = 0, queued tasks = 0, completed tasks = 0]
I/bik (15622): start() account=Account {name=signedout@, type=com.google.android.apps.maps} locale=de_DE
I/bik (15622): Scheduling next update in 0.000000 seconds: initial refresh
I/dyu (15622): Found 0 zoom mappings
I/dyu (15622): Zoom tables loaded
W/ekv (15622): No current context - attempting to create off-screen context
D/EGL_emulation(15622): eglCreateContext: 0x7bd90e96d0: maj 3 min 0 rcv 3
D/EGL_emulation(15622): eglMakeCurrent: 0x7bd90e96d0: ver 3 0 (tinfo 0x7dfe793080) (first time)
I/ekv (15622): Created GlConstants: eku{gpuVendor=Google (Apple), glVersion=OpenGL ES 3.0 (4.1 Metal - 83.1), glRenderer=Android Emulator OpenGL ES Translator (Apple M2 Pro), maxTextureSize=16384, maxVertexTextureImageUnits=16, maxVertexUniformVectors=1024, maxSupportedLineWidth=1, maxVertexAttribs=16, nonPowerOfTwoTextureSupport=FULL}
W/Settings(15622): Setting device_provisioned has moved from android.provider.Settings.System to android.provider.Settings.Global, returning read-only value.
I/bin (15622): Requested experimentIds= []
I/bgz (15622): Fetching new client parameters: Account {name=signedout@, type=com.google.android.apps.maps} de_DE
I/but (15622): getExecutor NETWORK_THREADPOOL CREATED bus@1d3b206[Running, pool size = 0, active threads = 0, queued tasks = 0, completed tasks = 0]
I/bpr (15622): Using Paint server URL: https://www.google.com/maps/vt
I/bzs (15622): FpsProfiler MAIN created on main
I/but (15622): getExecutor LOCATION_FRESHNESS_WAITING_THREADPOOL CREATED bus@26511bf[Running, pool size = 0, active threads = 0, queued tasks = 0, completed tasks = 0]
I/bfz (15622): ServerChannelManager got a client parameters update event.
I/bfz (15622): Updating the server URL based on client parameters update. Old URL: https://clients4.google.com/glm/mmap New URL: https://clients4.google.com/glm/mmap
I/bfz (15622): ServerChannelManager got a client parameters update event.
I/bfz (15622): Updating the server URL based on client parameters update. Old URL: https://www.google.com/maps/vt New URL: https://www.google.com/maps/vt
I/efj (15622): Create or open database: /storage/emulated/0/Android/data/io.flutter.plugins.googlemapsexample/cache/diskcache; secure file path: /data/user/0/io.flutter.plugins.googlemapsexample/app_/testdata
I/NativeHelper(15622): NativeHelper.ensureLibraryLoaded on thread main
I/din (15622): Network fetching: false
I/eoj (15622): Model SDK_GPHONE64_ARM64, Product name SDK_GPHONE64_ARM64, Board name GOLDFISH_ARM64, Manufacturer GOOGLE
W/eoj (15622): Model is not recognized, and therefore using default settings.
W/edy (15622): urls for epoch -1 not available.
I/din (15622): Network fetching: true
I/dyu (15622): Found 0 zoom mappings
I/dyu (15622): Zoom tables loaded
W/edy (15622): urls for epoch -1 not available.
I/din (15622): requestLegend unsuccessful for epoch -1 legend ROADMAP
W/edy (15622): urls for epoch -1 not available.
W/edy (15622): urls for epoch -1 not available.
W/edy (15622): urls for epoch -1 not available.
I/din (15622): requestLegend unsuccessful for epoch -1 legend ROADMAP
I/PlatformViewsController(15622): Using hybrid composition for platform view: 0
W/edy (15622): urls for epoch -1 not available.
I/din (15622): requestLegend unsuccessful for epoch -1 legend ROADMAP
W/edy (15622): urls for epoch -1 not available.
I/din (15622): requestLegend unsuccessful for epoch -1 legend ROADMAP
E/GoogleMapController(15622): Cannot enable MyLocation layer as location permissions are not granted
W/DynamiteModule(15622): Local module descriptor class for com.google.android.gms.googlecertificates not found.
I/DynamiteModule(15622): Considering local module com.google.android.gms.googlecertificates:0 and remote module com.google.android.gms.googlecertificates:7
I/DynamiteModule(15622): Selected remote version of com.google.android.gms.googlecertificates, version >= 7
W/ziparchive(15622): Unable to open '/data/user_de/0/com.google.android.gms/app_chimera/m/00000013/GoogleCertificates.dm': No such file or directory
W/ziparchive(15622): Unable to open '/data/user_de/0/com.google.android.gms/app_chimera/m/00000013/GoogleCertificates.dm': No such file or directory
D/TrafficStats(15622): tagSocket(151) with statsTag=0xffffffff, statsUid=-1
D/TrafficStats(15622): tagSocket(156) with statsTag=0x99e6744e, statsUid=-1
I/dyu (15622): Found 36 zoom mappings
I/dyu (15622): Zoom tables loaded
I/edy (15622): Current epoch is now 647
E/egu (15622): referer is null for url=https://www.google.com/maps/vt/sxforms?v=69ee71cd86745d2ef8e5e98b66a7fabd
E/egu (15622): referer is null for url=https://www.gstatic.com/maps/res/CompactLegend-Roadmap-69ee71cd86745d2ef8e5e98b66a7fabd
I/bgz (15622): Fetch new client parameters: Success!
I/bik (15622): Got a successful parameters response!
I/bik (15622): Scheduling next update in 21600.000000 seconds: refresh
I/dyu (15622): Found 36 zoom mappings
I/dyu (15622): Zoom tables loaded
I/bfz (15622): ServerChannelManager got a client parameters update event.
I/bfz (15622): ServerChannelManager got a client parameters update event.
I/bhr (15622): Scheduling save of client parameters.
I/bgx (15622): Save client parameters to cache at SavedClientParameters.data for account null and Locale de_DE
I/bhr (15622): Client parameters saved.
I/oglemapsexample(15622): Background concurrent copying GC freed 98271(7105KB) AllocSpace objects, 25(1172KB) LOS objects, 49% free, 7155KB/13MB, paused 3.210ms,138us total 228.319ms
E/EGL_emulation(15622): eglQueryContext 32c0 EGL_BAD_ATTRIBUTE
E/EGL_emulation(15622): tid 15622: eglQueryContext(2122): error 0x3004 (EGL_BAD_ATTRIBUTE)
D/HostConnection(15622): createUnique: call
D/HostConnection(15622): HostConnection::get() New Host Connection established 0x7bd90ebe90, tid 15750
D/HostConnection(15622): 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_vulkan ANDROID_EMU_deferred_vulkan_commands ANDROID_EMU_vulkan_null_optional_strings ANDROID_EMU_vulkan_create_resources_with_requirements ANDROID_EMU_YUV_Cache ANDROID_EMU_vulkan_ignored_handles ANDROID_EMU_has_shared_slots_host_memory_allocator ANDROID_EMU_vulkan_free_memory_sync ANDROID_EMU_vulkan_shader_float16_int8 ANDROID_EMU_vulkan_async_queue_submit ANDROID_EMU_vulkan_queue_submit_with_commands ANDROID_EMU_sync_buffer_data ANDROID_EMU_read_color_buffer_dma 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_0
D/EGL_emulation(15622): eglCreateContext: 0x7bd90ebdd0: maj 3 min 0 rcv 3
D/EGL_emulation(15622): eglMakeCurrent: 0x7bd90ebdd0: ver 3 0 (tinfo 0x7dfe793280) (first time)
D/EGL_emulation(15622): app_time_stats: avg=2242.47ms min=1197.62ms max=3287.33ms count=2
I/din (15622): Network fetching: true
I/din (15622): Network fetching: true
D/TrafficStats(15622): tagSocket(179) with statsTag=0xffffffff, statsUid=-1
D/TrafficStats(15622): tagSocket(184) with statsTag=0xffffffff, statsUid=-1
I/oglemapsexample(15622): ThreadFlipBegin blocked for 7.391ms
D/TrafficStats(15622): tagSocket(192) with statsTag=0xffffffff, statsUid=-1
I/NativeHelper(15622): NativeHelper.ensureLibraryLoaded on thread androidmapsapi-TilePrepPool1
I/oglemapsexample(15622): Compiler allocated 5792KB to compile dyn dyr.k(bar, gze, dyg, byte[], boolean, cav, cwl, java.lang.Iterable)
I/oglemapsexample(15622): Compiler allocated 6145KB to compile void duo.V(dyr, eog, android.content.res.Resources, dwv, egz, boolean)
I/oglemapsexample(15622): Compiler allocated 6609KB to compile void duo.V(dyr, eog, android.content.res.Resources, dwv, egz, boolean)
I/oglemapsexample(15622): Background young concurrent copying GC freed 123591(4566KB) AllocSpace objects, 31(2352KB) LOS objects, 26% free, 13MB/18MB, paused 53us,63us total 126.363ms
D/EGL_emulation(15622): app_time_stats: avg=127.74ms min=12.55ms max=520.69ms count=8
I/bry (15622): Initial labeling completed.
E/egu (15622): referer is null for url=https://www.gstatic.com/maps/res/CompactLegend-Navigation-69ee71cd86745d2ef8e5e98b66a7fabd
E/egu (15622): referer is null for url=https://www.gstatic.com/maps/res/CompactLegend-NavigationLowLight-69ee71cd86745d2ef8e5e98b66a7fabd
I/oglemapsexample(15622): Compiler allocated 4133KB to compile void dnw.n(dor)
I/oglemapsexample(15622): ThreadFlipBegin blocked for 12.369ms
I/oglemapsexample(15622): IncrementDisableThreadFlip blocked for 6.242ms
|
Thanks for the update. From above logs, another entry is |
Thank you. I've installed the package using Then I edited main() to request for Location permission.
The error indeed disappeared, but takeScreenshot is still stuck 😞 . By the way, if Flutter offers a Google Maps example with Integration Tests, could Flutter Team please extend the example with a takeScreenshot() integration test? Would be great if the full suite of Integration Tests is covered. Thank you in advance for your effort. Logs
|
Thanks for the update and your patience while we try to figure out reason.
Looking at it, it probably doesn't seem specific to integration_test or Flutter per se, as I see similar issue reported in another framework: https://forum.ionicframework.com/t/ionic-capacitor-google-maps-plugin-issue-on-android/231421 As a last try before we make this issue actionable, can you take a look at this article and see if it helps further ? https://blog.codemagic.io/flutter-automated-screenshot-testing/ |
Thank you for sharing the links. About the Google Maps error, I couldn't find any solution for it unfortunately. I see that even in the link you shared (Ionic) a solution hasn't been found. The Codemagic article is helpful in all cases except Google Maps. Please note that I've already successfully implemented taking screenshots in integration tests in my personal project. It's a very helpful feature of Flutter, really helps me save time with screenshots. The only case that doesn't work is widgets with Google Maps. Would really be great if the Flutter example project is extended with a take screenshot case for Google Maps. Thank you. |
Thanks for the update. Using the steps to replicate and code sample provided in original description, I was able to replicate the reported behavior. stable, master flutter doctor -v
|
@wonderingdev I suggest you to file a new documentation issue so that we can track it properly. |
This may be an issue with platform views in general (or maybe HC platform views) rather than maps specifically; we'll need to test further. |
@johnmccutchan FYI; this may be a platform view issue in general (although we haven't validated that yet). |
@darshankawar @stuartmorgan By the way, |
I'm experiencing similar hangs on a physical Android device at the call to |
This issue is assigned to @johnmccutchan but has had no recent status updates. Please consider unassigning this issue if it is not going to be addressed in the near future. This allows people to have a clearer picture of what work is actually planned. Thanks! |
@jonahwilliams Any idea what could be going on here? |
Is there an existing issue for this?
Steps to reproduce
app/src/main/AndroidManifest.xml
and provide a Google Api Key atcom.google.android.geo.API_KEY
.test_driver/integration_test.dart
and add the following code:screenshots
folder under project root folder.integration_test/google_map_test.dart
and addtakeScreenshot
totestCompassToggle
test.flutter drive --driver=test_driver/integration_test.dart --target=integration_test/google_maps_test.dart
Expected results
On
testCompassToggle
test run the screenshotmyscreenshot.png
should be generated insidescreenshots
folder.Actual results
The
await binding.takeScreenshot("myscreenshot");
method call hangs indefinitely and the test doesn't finish. A screenshot isn't generated. The issue is reproducing on both real device and emulator.Code sample
I've presented in the steps the code samples and the steps needed to reproduce the issue in "Steps to Reproduce" section.
Screenshots or Video
Screenshots / Video demonstration
[Upload media here]
Logs
Flutter Doctor output
Doctor output
The text was updated successfully, but these errors were encountered: