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

IntegrationTestWidgetsFlutterBinding takeScreenshot gets stuck for GoogleMaps #127306

Open
2 tasks done
wonderingdev opened this issue May 22, 2023 · 16 comments
Open
2 tasks done
Assignees
Labels
a: platform-views Embedding Android/iOS views in Flutter apps f: integration_test The flutter/packages/integration_test plugin found in release: 3.10 Found to occur in 3.10 found in release: 3.11 Found to occur in 3.11 framework flutter/packages/flutter repository. See also f: labels. has reproducible steps The issue has been confirmed reproducible and is ready to work on p: maps Google Maps plugin P2 Important issues not at the top of the work list package flutter/packages repository. See also p: labels. platform-android Android applications specifically team-android Owned by Android platform team triaged-android Triaged by Android platform team

Comments

@wonderingdev
Copy link

wonderingdev commented May 22, 2023

Is there an existing issue for this?

Steps to reproduce

  1. Go to flutter/packages google_maps_flutter example and open it in Android Studio.
  2. Use Flutter 3.10.1 • channel stable
  3. Go to app/src/main/AndroidManifest.xml and provide a Google Api Key at com.google.android.geo.API_KEY.
  4. Go to test_driver/integration_test.dart and add the following code:
import 'dart:io';

import 'package:integration_test/integration_test_driver_extended.dart';

Future<void> main() async {
  return integrationDriver(
    onScreenshot: (String name, List<int> image,
        [Map<String, Object?>? args]) async {
      final File img = File('screenshots/$name.png');
      img.writeAsBytesSync(image);
      // Return false if the screenshot is invalid.
      return true;
    },
  );
}
  1. Create a screenshots folder under project root folder.
  2. Go to integration_test/google_map_test.dart and add takeScreenshot to testCompassToggle test.
testWidgets('testCompassToggle', (WidgetTester tester) async {
    final Key key = GlobalKey();
    final Completer<int> mapIdCompleter = Completer<int>();
    await tester.pumpWidget(Directionality(
      textDirection: TextDirection.ltr,
      child: GoogleMap(
        key: key,
        initialCameraPosition: _kInitialCameraPosition,
        compassEnabled: false,
        onMapCreated: (GoogleMapController controller) {
          mapIdCompleter.complete(controller.mapId);
        },
      ),
    ));

    final int mapId = await mapIdCompleter.future;
    final GoogleMapsInspectorPlatform inspector =
        GoogleMapsInspectorPlatform.instance!;
    bool compassEnabled = await inspector.isCompassEnabled(mapId: mapId);
    expect(compassEnabled, false);

    await tester.pumpWidget(Directionality(
      textDirection: TextDirection.ltr,
      child: GoogleMap(
        key: key,
        initialCameraPosition: _kInitialCameraPosition,
        onMapCreated: (GoogleMapController controller) {
          fail('OnMapCreated should get called only once.');
        },
      ),
    ));

    compassEnabled = await inspector.isCompassEnabled(mapId: mapId);
    expect(compassEnabled, true);

    // Added take screenshot <<<<
    await binding.convertFlutterSurfaceToImage();

    await tester.pumpAndSettle();

    await binding.takeScreenshot("myscreenshot");
  });
  1. Run the test from project root folder with the command: flutter drive --driver=test_driver/integration_test.dart --target=integration_test/google_maps_test.dart

Expected results

On testCompassToggle test run the screenshot myscreenshot.png should be generated inside screenshots 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

ivan@Ivans-Mac-mini example % flutter drive --driver=test_driver/integration_test.dart --target=integration_test/google_map_test.dart
Target file "integration_test/google_map_test.dart" not found.
ivan@Ivans-Mac-mini example % flutter drive --driver=test_driver/integration_test.dart --target=integration_test/google_maps_test.dart 
^C%                                                                                                                            ivan@Ivans-Mac-mini example % clear
ivan@Ivans-Mac-mini example % flutter drive --driver=test_driver/integration_test.dart --target=integration_test/google_maps_test.dart
Resolving 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)
  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!
Connected devices:
Pixel 4a (mobile)           • 0A281JEC208152 • android-arm64  • Android 13 (API 33)
sdk gphone64 arm64 (mobile) • emulator-5554  • android-arm64  • Android 13 (API 33) (emulator)
sdk gphone64 arm64 (mobile) • emulator-5556  • android-arm64  • Android 13 (API 33) (emulator)
macOS (desktop)             • macos          • darwin-arm64   • macOS 13.3.1 22E772610a darwin-arm64
Chrome (web)                • chrome         • web-javascript • Google Chrome 113.0.5672.126

No wireless devices were found.

[1]: Pixel 4a (0A281JEC208152)
[2]: sdk gphone64 arm64 (emulator-5554)
[3]: sdk gphone64 arm64 (emulator-5556)
[4]: macOS (macos)
[5]: Chrome (chrome)
Please choose one (or "q" to quit): 1
Running Gradle task 'assembleDebug'...                              4.6s
✓  Built build/app/outputs/flutter-apk/app-debug.apk.
Installing build/app/outputs/flutter-apk/app-debug.apk...           4.2s
I/oglemapsexample(14942): Compiler allocated 4413KB to compile void android.view.ViewRootImpl.performTraversals()
VMServiceFlutterDriver: Connecting to Flutter application at http://127.0.0.1:64996/-mPzezvXQ7k=/
VMServiceFlutterDriver: Isolate found with number: 743515918418887
VMServiceFlutterDriver: Isolate is paused at start.
VMServiceFlutterDriver: Attempting to resume isolate
I/flutter (14942): 00:00 +0: testCompassToggle
VMServiceFlutterDriver: Connected to Flutter application.
W/Parcel  (14942): Expecting binder but got null!
D/MapsInitializer(14942): preferredRenderer: null
D/zzcb    (14942): preferredRenderer: null
I/zzcb    (14942): Making Creator dynamically
I/DynamiteModule(14942): Considering local module com.google.android.gms.maps_dynamite:0 and remote module
com.google.android.gms.maps_dynamite:203115000
I/DynamiteModule(14942): Selected remote version of com.google.android.gms.maps_dynamite, version >= 203115000
V/DynamiteModule(14942): Dynamite loader version >= 2, using loadModule2NoCrashUtils
W/System  (14942): ClassLoader referenced unknown path: 
D/nativeloader(14942): Configuring classloader-namespace for other apk . target_sdk_version=33, uses_libraries=,
library_path=/data/app/~~65Pju9QF0s1RXZ-XSNKHwA==/com.google.android.gms-bqiUoiBUMa-cOy08aUZk7Q==/lib/arm64:/data/app/~~65Pju9Q
F0s1RXZ-XSNKHwA==/com.google.android.gms-bqiUoiBUMa-cOy08aUZk7Q==/base.apk!/lib/arm64-v8a,
permitted_path=/data:/mnt/expand:/data/user/0/com.google.android.gms
I/DynamiteLoaderV2Impl(14942): [71] com.google.android.gms.maps_dynamite
I/Google Maps Android API(14942): Google Play services client version: 12451000
D/CompatibilityChangeReporter(14942): Compat change id reported: 183155436; UID 10266; state: DISABLED
I/SnapshotHandler(14942): Unable to retrieve flag snapshot for
com.google.android.gms.maps#io.flutter.plugins.googlemapsexample, using defaults.
I/Google Maps Android API(14942): Google Play services package version: 231613044
I/Google Maps Android API(14942): Google Play services maps renderer version(legacy): 203115000
D/MapsInitializer(14942): loadedRenderer: LEGACY
D/zzcb    (14942): preferredRenderer: null
I/Google Maps Android API(14942): Google Play services package version: 231613044
I/Google Maps Android API(14942): Google Play services maps renderer version(legacy): 203115000
D/CompatibilityChangeReporter(14942): Compat change id reported: 210923482; UID 10266; state: DISABLED
D/CompatibilityChangeReporter(14942): Compat change id reported: 37756858; UID 10266; state: ENABLED
D/CompatibilityChangeReporter(14942): Compat change id reported: 171228096; UID 10266; state: ENABLED
I/PlatformViewsController(14942): Using hybrid composition for platform view: 0
E/GoogleMapController(14942): Cannot enable MyLocation layer as location permissions are not granted
I/bb      (14942): Successfully registered with Phenotype.
D/TrafficStats(14942): tagSocket(163) with statsTag=0x30001101, statsUid=-1
D/TrafficStats(14942): tagSocket(192) with statsTag=0x30001101, statsUid=-1
D/TrafficStats(14942): tagSocket(201) with statsTag=0x30001101, statsUid=-1
D/TrafficStats(14942): tagSocket(208) with statsTag=0x30001101, statsUid=-1
W/DynamiteModule(14942): Local module descriptor class for com.google.android.gms.googlecertificates not found.
I/DynamiteModule(14942): Considering local module com.google.android.gms.googlecertificates:0 and remote module
com.google.android.gms.googlecertificates:7
I/DynamiteModule(14942): Selected remote version of com.google.android.gms.googlecertificates, version >= 7
I/DynamiteLoaderV2Impl(14942): [71] com.google.android.gms.googlecertificates
I/SnapshotHandler(14942): Unable to retrieve flag snapshot for
com.google.android.libraries.consentverifier#io.flutter.plugins.googlemapsexample, using defaults.
W/MobStoreFlagStore(14942): Unable to update local snapshot for
com.google.android.libraries.consentverifier#io.flutter.plugins.googlemapsexample, may result in stale flags.
W/MobStoreFlagStore(14942): java.util.concurrent.ExecutionException: java.lang.SecurityException: GoogleCertificatesRslt: not
allowed: pkg=io.flutter.plugins.googlemapsexample, sha256=[9ec0a203d6c494daf12a14ea7db1980252b60c3a1c1780953ee049d160875e56],
atk=false, ver=231613044.true (go/gsrlt)
W/MobStoreFlagStore(14942):     at ajh.s(:com.google.android.gms.dynamite_mapsdynamite@231613044@23.16.13 (190400-0):3)
W/MobStoreFlagStore(14942):     at ajh.get(:com.google.android.gms.dynamite_mapsdynamite@231613044@23.16.13 (190400-0):2)
W/MobStoreFlagStore(14942):     at akr.g(:com.google.android.gms.dynamite_mapsdynamite@231613044@23.16.13 (190400-0):2)
W/MobStoreFlagStore(14942):     at yp.c(:com.google.android.gms.dynamite_mapsdynamite@231613044@23.16.13 (190400-0):1)
W/MobStoreFlagStore(14942):     at yr.run(:com.google.android.gms.dynamite_mapsdynamite@231613044@23.16.13 (190400-0):0)
W/MobStoreFlagStore(14942):     at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:463)
W/MobStoreFlagStore(14942):     at java.util.concurrent.FutureTask.run(FutureTask.java:264)
W/MobStoreFlagStore(14942):     at
java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:307)
W/MobStoreFlagStore(14942):     at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1137)
W/MobStoreFlagStore(14942):     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:637)
W/MobStoreFlagStore(14942):     at java.lang.Thread.run(Thread.java:1012)
W/MobStoreFlagStore(14942): Caused by: java.lang.SecurityException: GoogleCertificatesRslt: not allowed:
pkg=io.flutter.plugins.googlemapsexample, sha256=[9ec0a203d6c494daf12a14ea7db1980252b60c3a1c1780953ee049d160875e56], atk=false,
ver=231613044.true (go/gsrlt)
W/MobStoreFlagStore(14942):     at android.os.Parcel.createExceptionOrNull(Parcel.java:3011)
W/MobStoreFlagStore(14942):     at android.os.Parcel.createException(Parcel.java:2995)
W/MobStoreFlagStore(14942):     at android.os.Parcel.readException(Parcel.java:2978)
W/MobStoreFlagStore(14942):     at android.os.Parcel.readException(Parcel.java:2920)
W/MobStoreFlagStore(14942):     at fe.c(:com.google.android.gms.dynamite_mapsdynamite@231613044@23.16.13 (190400-0):2)
W/MobStoreFlagStore(14942):     at rs.a(:com.google.android.gms.dynamite_mapsdynamite@231613044@23.16.13 (190400-0):4)
W/MobStoreFlagStore(14942):     at jk.e(:com.google.android.gms.dynamite_mapsdynamite@231613044@23.16.13 (190400-0):2)
W/MobStoreFlagStore(14942):     at ki.t(:com.google.android.gms.dynamite_mapsdynamite@231613044@23.16.13 (190400-0):2)
W/MobStoreFlagStore(14942):     at ki.u(:com.google.android.gms.dynamite_mapsdynamite@231613044@23.16.13 (190400-0):3)
W/MobStoreFlagStore(14942):     at ki.e(:com.google.android.gms.dynamite_mapsdynamite@231613044@23.16.13 (190400-0):2)
W/MobStoreFlagStore(14942):     at km.handleMessage(:com.google.android.gms.dynamite_mapsdynamite@231613044@23.16.13
(190400-0):74)
W/MobStoreFlagStore(14942):     at android.os.Handler.dispatchMessage(Handler.java:102)
W/MobStoreFlagStore(14942):     at android.os.Looper.loopOnce(Looper.java:201)
W/MobStoreFlagStore(14942):     at android.os.Looper.loop(Looper.java:288)
W/MobStoreFlagStore(14942):     at android.os.HandlerThread.run(HandlerThread.java:67)
VMServiceFlutterDriver: request_data message is taking a long time to complete...

Flutter Doctor output

Doctor output
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 3.10.1, on macOS 13.3.1 22E772610a darwin-arm64, locale en-DE)
[✓] Android toolchain - develop for Android devices (Android SDK version 33.0.1)
[✓] Xcode - develop for iOS and macOS (Xcode 14.2)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2022.1)
[✓] IntelliJ IDEA Community Edition (version 2023.1)
[✓] VS Code (version 1.76.2)
[✓] Connected device (5 available)
[✓] Network resources

• No issues found!
@wonderingdev wonderingdev changed the title IntegrationTestWidgetsFlutterBinding takeScreenshot gets stuck for GoogleMap IntegrationTestWidgetsFlutterBinding takeScreenshot gets stuck for GoogleMaps May 22, 2023
@darshankawar darshankawar added the in triage Presently being triaged by the triage team label May 22, 2023
@darshankawar
Copy link
Member

@wonderingdev
Can you take a look at this documentation / usage and see if it helps in your case ?

@darshankawar darshankawar added the waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds label May 22, 2023
@wonderingdev
Copy link
Author

wonderingdev commented May 22, 2023

@wonderingdev Can you take a look at this documentation / usage and see if it helps in your case ?

@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 binding.takeScreenshot() method. So that's why I decided to open an Issue here, as it is a blocker for me. Maybe Flutter team could help.

@github-actions github-actions bot removed the waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds label May 22, 2023
@darshankawar
Copy link
Member

Thanks for the update @wonderingdev
Looking at the error log you provided, the main cause seems to be:

java.util.concurrent.ExecutionException: java.lang.SecurityException: GoogleCertificatesRslt: not allowed: which led me to this similar issue : #109115 that was closed citing not in scope of the plugin: #109115 (comment)
Please check the same and underlying comments to see if it helps in your case. There are few workarounds / solutions mentioned too.

@darshankawar darshankawar added the waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds label May 23, 2023
@wonderingdev
Copy link
Author

wonderingdev commented May 23, 2023

Thanks for the update @wonderingdev Looking at the error log you provided, the main cause seems to be:

java.util.concurrent.ExecutionException: java.lang.SecurityException: GoogleCertificatesRslt: not allowed: which led me to this similar issue : #109115 that was closed citing not in scope of the plugin: #109115 (comment) Please check the same and underlying comments to see if it helps in your case. There are few workarounds / solutions mentioned too.

@darshankawar Thank you.
I've tried the solution with the latest renderer mentioned in the linked pages, and the error indeed disappeared.
The takeScreenshot is still stuck though.

Here's how I've tested it by adapting the above Steps to Reproduce:

  1. Modified main.dart to use the latest renderer:
//...

class MapsDemo extends StatelessWidget {

//....

  @override
  Widget build(BuildContext context) {
    return Scaffold(
        appBar: AppBar(title: const Text('GoogleMaps examples')),
        body: MapUiPage());  // <<<< switched to MapUIPage() here
  }
}

void main() async {
    WidgetsFlutterBinding.ensureInitialized();
  AndroidMapRenderer mapRenderer = AndroidMapRenderer.platformDefault;
  final GoogleMapsFlutterPlatform mapsImplementation =
      GoogleMapsFlutterPlatform.instance;
  if (mapsImplementation is GoogleMapsFlutterAndroid) {
    mapRenderer = await mapsImplementation
        .initializeWithRenderer(AndroidMapRenderer.latest);
  }
  runApp(const MaterialApp(home: MapsDemo()));
}
  1. Modified the google_maps_test.dart like this:
//....

// Added reference to main.dart
import 'package:google_maps_flutter_example/main.dart' as app;

//....

// Modified the testCompassToggle to wait for the GoogleMap to be rendered

testWidgets('testCompassToggle', (WidgetTester tester) async {

    app.main();

    do {
      await tester.pump();
    } while (
    tester.widgetList(find.byType(GoogleMap)).isEmpty);

    await binding.convertFlutterSurfaceToImage();

    await tester.pumpAndSettle();

    await binding.takeScreenshot("myscreenshot");
  });

The takeScreenshot() still gets stuck though. Here are the logs:

Logs
Resolving 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

@github-actions github-actions bot removed the waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds label May 23, 2023
@darshankawar
Copy link
Member

Thanks for the update. From above logs, another entry is E/GoogleMapController(15622): Cannot enable MyLocation layer as location permissions are not granted which points to open issue #34157. See whether that issue could be leading the behavior you are seeing or not.

@darshankawar darshankawar added the waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds label May 24, 2023
@wonderingdev
Copy link
Author

wonderingdev commented May 24, 2023

Thank you.

I've installed the package using flutter pub add permission_handler

Then I edited main() to request for Location permission.

void main() async {
  WidgetsFlutterBinding.ensureInitialized();
  await Permission.location.request();  // <<<<<<<<<< Request location permission
  AndroidMapRenderer mapRenderer = AndroidMapRenderer.platformDefault;
  final GoogleMapsFlutterPlatform mapsImplementation =
      GoogleMapsFlutterPlatform.instance;
  if (mapsImplementation is GoogleMapsFlutterAndroid) {
    mapRenderer = await mapsImplementation
        .initializeWithRenderer(AndroidMapRenderer.latest);
  }
  runApp(const MaterialApp(home: MapsDemo()));
}

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

ivan@Ivans-Mac-mini example % flutter drive --driver=test_driver/integration_test.dart --target=integration_test/google_maps_test.dart
Resolving dependencies... 
  build_runner_core 7.2.8 (7.2.9 available)
  built_value 8.5.0 (8.6.0 available)
  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)
  graphs 2.3.0 (2.3.1 available)
  logging 1.1.1 (1.2.0 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'...                              4.7s
✓  Built build/app/outputs/flutter-apk/app-debug.apk.
Installing build/app/outputs/flutter-apk/app-debug.apk...          384ms
D/EGL_emulation(30145): eglCreateContext: 0x7a18e91350: maj 3 min 0 rcv 3
I/oglemapsexample(30145): Compiler allocated 4579KB to compile void android.view.ViewRootImpl.performTraversals()
VMServiceFlutterDriver: Connecting to Flutter application at http://127.0.0.1:65345/8KmtoybHHtw=/
VMServiceFlutterDriver: Isolate found with number: 3653050303659823
VMServiceFlutterDriver: Isolate is paused at start.
VMServiceFlutterDriver: Attempting to resume isolate
I/flutter (30145): 00:00 +0: testCompassToggle
VMServiceFlutterDriver: Connected to Flutter application.
W/Parcel  (30145): Expecting binder but got null!
D/EGL_emulation(30145): app_time_stats: avg=2.05ms min=0.57ms max=32.09ms count=62
D/EGL_emulation(30145): app_time_stats: avg=1.34ms min=0.81ms max=2.09ms count=61
D/EGL_emulation(30145): app_time_stats: avg=1.11ms min=0.57ms max=3.07ms count=61
D/EGL_emulation(30145): app_time_stats: avg=1.23ms min=0.66ms max=3.43ms count=60
VMServiceFlutterDriver: request_data message is taking a long time to complete...
D/EGL_emulation(30145): app_time_stats: avg=1.09ms min=0.57ms max=3.18ms count=61
D/EGL_emulation(30145): app_time_stats: avg=1.19ms min=0.57ms max=2.91ms count=60
D/EGL_emulation(30145): app_time_stats: avg=1.21ms min=0.66ms max=2.15ms count=60
D/EGL_emulation(30145): app_time_stats: avg=1.26ms min=0.65ms max=2.50ms count=61
D/EGL_emulation(30145): app_time_stats: avg=10.03ms min=0.73ms max=21.87ms count=59
D/EGL_emulation(30145): app_time_stats: avg=17.20ms min=11.68ms max=28.71ms count=59
D/EGL_emulation(30145): app_time_stats: avg=17.29ms min=8.97ms max=30.33ms count=59
D/EGL_emulation(30145): app_time_stats: avg=3.64ms min=1.52ms max=10.62ms count=61
D/EGL_emulation(30145): app_time_stats: avg=7.49ms min=1.45ms max=57.74ms count=53
D/EGL_emulation(30145): app_time_stats: avg=4.87ms min=1.84ms max=19.78ms count=60
D/EGL_emulation(30145): app_time_stats: avg=5.49ms min=2.49ms max=28.37ms count=57
D/EGL_emulation(30145): app_time_stats: avg=4.67ms min=1.66ms max=24.98ms count=60
^CCaught SIGINT

ivan@Ivans-Mac-mini example % clear
ivan@Ivans-Mac-mini example % flutter drive --driver=test_driver/integration_test.dart --target=integration_test/google_maps_test.dart
Resolving dependencies... 
  build_runner_core 7.2.8 (7.2.9 available)
  built_value 8.5.0 (8.6.0 available)
  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)
  graphs 2.3.0 (2.3.1 available)
  logging 1.1.1 (1.2.0 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,764ms
✓  Built build/app/outputs/flutter-apk/app-debug.apk.
Installing build/app/outputs/flutter-apk/app-debug.apk...        1,473ms
I/oglemapsexample(30449): Compiler allocated 4579KB to compile void android.view.ViewRootImpl.performTraversals()
VMServiceFlutterDriver: Connecting to Flutter application at http://127.0.0.1:49236/pzDXYr34DYc=/
VMServiceFlutterDriver: Isolate found with number: 1829347949670623
VMServiceFlutterDriver: Isolate is paused at start.
VMServiceFlutterDriver: Attempting to resume isolate
I/flutter (30449): 00:00 +0: testCompassToggle
VMServiceFlutterDriver: Connected to Flutter application.
W/Parcel  (30449): Expecting binder but got null!
D/EGL_emulation(30449): app_time_stats: avg=28.42ms min=2.09ms max=181.62ms count=33
D/EGL_emulation(30449): app_time_stats: avg=6.90ms min=1.42ms max=31.34ms count=54
D/EGL_emulation(30449): app_time_stats: avg=7.83ms min=2.67ms max=26.34ms count=56
D/EGL_emulation(30449): app_time_stats: avg=8.94ms min=2.21ms max=23.30ms count=56
VMServiceFlutterDriver: request_data message is taking a long time to complete...
D/EGL_emulation(30449): app_time_stats: avg=7.23ms min=2.06ms max=27.70ms count=59
D/EGL_emulation(30449): app_time_stats: avg=4.19ms min=1.14ms max=11.12ms count=60
D/EGL_emulation(30449): app_time_stats: avg=4.70ms min=2.15ms max=15.69ms count=58
D/EGL_emulation(30449): app_time_stats: avg=5.09ms min=2.19ms max=14.24ms count=57
D/EGL_emulation(30449): app_time_stats: avg=15.52ms min=2.02ms max=24.69ms count=59
D/EGL_emulation(30449): app_time_stats: avg=4.51ms min=1.23ms max=23.79ms count=59
D/EGL_emulation(30449): app_time_stats: avg=15.92ms min=2.35ms max=22.05ms count=59
D/EGL_emulation(30449): app_time_stats: avg=8.69ms min=1.49ms max=20.97ms count=59
D/EGL_emulation(30449): app_time_stats: avg=7.58ms min=1.50ms max=22.94ms count=60
D/EGL_emulation(30449): app_time_stats: avg=2.88ms min=1.37ms max=8.12ms count=59
D/EGL_emulation(30449): app_time_stats: avg=3.45ms min=1.66ms max=9.06ms count=60
D/EGL_emulation(30449): app_time_stats: avg=6.53ms min=2.04ms max=32.93ms count=58
D/EGL_emulation(30449): app_time_stats: avg=4.57ms min=1.82ms max=29.38ms count=59
D/EGL_emulation(30449): app_time_stats: avg=5.41ms min=1.42ms max=20.15ms count=57
D/EGL_emulation(30449): app_time_stats: avg=6.37ms min=1.29ms max=22.54ms count=59
D/EGL_emulation(30449): app_time_stats: avg=6.41ms min=1.73ms max=20.11ms count=59
D/EGL_emulation(30449): app_time_stats: avg=4.09ms min=2.06ms max=16.16ms count=57
D/EGL_emulation(30449): app_time_stats: avg=4.11ms min=1.29ms max=14.28ms count=58
D/EGL_emulation(30449): app_time_stats: avg=3.78ms min=1.39ms max=9.13ms count=58
D/EGL_emulation(30449): app_time_stats: avg=12.33ms min=1.80ms max=25.39ms count=60
D/EGL_emulation(30449): app_time_stats: avg=7.23ms min=1.83ms max=22.80ms count=58
D/EGL_emulation(30449): app_time_stats: avg=1.73ms min=0.55ms max=5.98ms count=58
D/CompatibilityChangeReporter(30449): Compat change id reported: 78294732; UID 10167; state: DISABLED
D/MapsInitializer(30449): preferredRenderer: LATEST
D/zzcb    (30449): preferredRenderer: LATEST
I/zzcb    (30449): Making Creator dynamically
W/ziparchive(30449): Unable to open '/data/user_de/0/com.google.android.gms/app_chimera/m/0000000f/DynamiteLoader.dm': No such file or directory
W/ziparchive(30449): Unable to open '/data/user_de/0/com.google.android.gms/app_chimera/m/0000000f/DynamiteLoader.dm': No such file or directory
I/DynamiteModule(30449): Considering local module com.google.android.gms.maps_core_dynamite:0 and remote module com.google.android.gms.maps_core_dynamite:231112103
I/DynamiteModule(30449): Selected remote version of com.google.android.gms.maps_core_dynamite, version >= 231112103
V/DynamiteModule(30449): Dynamite loader version >= 2, using loadModule2NoCrashUtils
W/System  (30449): ClassLoader referenced unknown path: 
D/nativeloader(30449): Configuring classloader-namespace for other apk . target_sdk_version=33, uses_libraries=,
library_path=/data/app/~~QKLIU6ES8s6hee-YC_uS_g==/com.google.android.gms-MevPo1Occ96s4fyQJULEyQ==/lib/arm64:/data/app/~~QKLIU6ES8s6hee-YC_uS_g==/com.google.android.gms-MevPo1Occ96s4fyQJULEyQ==/base.apk!/lib/arm64-v8a,
permitted_path=/data:/mnt/expand:/data/user/0/com.google.android.gms
W/ziparchive(30449): Unable to open '/data/user_de/0/com.google.android.gms/app_chimera/m/00000015/dl-MapsCoreDynamite.integ_231112103100400.dm': No such file or directory
W/ziparchive(30449): Unable to open '/data/user_de/0/com.google.android.gms/app_chimera/m/00000015/dl-MapsCoreDynamite.integ_231112103100400.dm': No such file or directory
I/Google Android Maps SDK(30449): Google Play services client version: 12451000
I/Google Android Maps SDK(30449): Google Play services package version: 231613044
I/Google Android Maps SDK(30449): Google Play services maps renderer version(maps_core): 231112103
D/CompatibilityChangeReporter(30449): Compat change id reported: 183155436; UID 10167; state: DISABLED
I/SnapshotHandler(30449): Unable to retrieve flag snapshot for com.google.android.gms.maps#io.flutter.plugins.googlemapsexample, using defaults.
D/MapsInitializer(30449): loadedRenderer: LATEST
D/MapsInitializer(30449): preferredRenderer: null
D/zzcb    (30449): preferredRenderer: null
I/Google Android Maps SDK(30449): Google Play services package version: 231613044
I/Google Android Maps SDK(30449): Google Play services maps renderer version(maps_core): 231112103
D/CompatibilityChangeReporter(30449): Compat change id reported: 210923482; UID 10167; state: DISABLED
D/CompatibilityChangeReporter(30449): Compat change id reported: 37756858; UID 10167; state: ENABLED
D/CompatibilityChangeReporter(30449): Compat change id reported: 171228096; UID 10167; state: ENABLED
W/oglemapsexample(30449): Accessing hidden method Ldalvik/system/VMStack;->getStackClass2()Ljava/lang/Class; (unsupported, reflection, allowed)
I/NativeHelper(30449): NativeHelper.setContext(androidx.multidex.MultiDexApplication@825e433) on thread main
I/btx     (30449): Starting UI_THREAD
I/but     (30449): getExecutor  UI_THREAD  CREATED  Thread[main,5,main]
I/but     (30449): getExecutor  BACKGROUND_THREADPOOL  CREATED  bus@40b7504[Running, pool size = 0, active threads = 0, queued tasks = 0, completed tasks = 0]
I/NativeHelper(30449): NativeHelper.ensureLibraryLoaded on thread androidmapsapi-DefaultPool2
I/NativeHelper(30449): About to load JNI library on thread androidmapsapi-DefaultPool2
W/NativeHelper(30449): safeLoadLibrary: gmm-jni
D/nativeloader(30449): 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/00000015/dl-MapsCoreDynamite.integ_231112103100400.apk!/lib/arm64-v8a, permitted_path=/data:/mnt/expand
I/but     (30449): getExecutor  LIGHTWEIGHT_THREADPOOL  CREATED  bus@faaf80f[Running, pool size = 0, active threads = 0, queued tasks = 0, completed tasks = 0]
I/native  (30449): I0000 00:00:1684915912.791052   30643 jni_init.cc:8] Initializing JNI...
I/NativeHelper(30449): Initializing JNI.
I/NativeHelper(30449): JNI initialized.
I/bgx     (30449): No cached client parameters found
I/bik     (30449): start()  account=Account {name=signedout@, type=com.google.android.apps.maps}  locale=en_US
I/but     (30449): getExecutor  TILE_PREP_THREADPOOL  CREATED  bus@eea5cfc[Running, pool size = 0, active threads = 0, queued tasks = 0, completed tasks = 0]
I/but     (30449): getExecutor  GMM_PICKER  CREATED  bus@d63d1da[Running, pool size = 0, active threads = 0, queued tasks = 0, completed tasks = 0]
I/dyu     (30449): Found 0 zoom mappings
I/dyu     (30449): Zoom tables loaded
I/bik     (30449): Scheduling next update in 0.000000 seconds: initial refresh
W/ekv     (30449): No current context - attempting to create off-screen context
D/EGL_emulation(30449): eglCreateContext: 0x7a18e99450: maj 3 min 0 rcv 3
D/EGL_emulation(30449): eglMakeCurrent: 0x7a18e99450: ver 3 0 (tinfo 0x7c3c448080) (first time)
W/Settings(30449): Setting device_provisioned has moved from android.provider.Settings.System to android.provider.Settings.Global, returning read-only value.
I/ekv     (30449): 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}
I/bin     (30449): Requested experimentIds= []
I/bgz     (30449): Fetching new client parameters: Account {name=signedout@, type=com.google.android.apps.maps}  en_US
I/but     (30449): getExecutor  NETWORK_THREADPOOL  CREATED  bus@db046bf[Running, pool size = 0, active threads = 0, queued tasks = 0, completed tasks = 0]
I/bpr     (30449): Using Paint server URL: https://www.google.com/maps/vt
I/bzs     (30449): FpsProfiler MAIN created on main
I/but     (30449): getExecutor  LOCATION_FRESHNESS_WAITING_THREADPOOL  CREATED  bus@6f9dd89[Running, pool size = 0, active threads = 0, queued tasks = 0, completed tasks = 0]
I/bfz     (30449): ServerChannelManager got a client parameters update event.
I/bfz     (30449): 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     (30449): ServerChannelManager got a client parameters update event.
I/bfz     (30449): 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     (30449): 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(30449): NativeHelper.ensureLibraryLoaded on thread main
I/din     (30449): Network fetching: false
I/eoj     (30449): Model SDK_GPHONE64_ARM64, Product name SDK_GPHONE64_ARM64, Board name GOLDFISH_ARM64, Manufacturer GOOGLE
W/eoj     (30449): Model is not recognized, and therefore using default settings.
W/edy     (30449): urls for epoch -1 not available.
I/din     (30449): Network fetching: true
I/dyu     (30449): Found 0 zoom mappings
I/dyu     (30449): Zoom tables loaded
W/edy     (30449): urls for epoch -1 not available.
I/din     (30449): requestLegend unsuccessful for epoch -1 legend ROADMAP
W/edy     (30449): urls for epoch -1 not available.
W/edy     (30449): urls for epoch -1 not available.
W/edy     (30449): urls for epoch -1 not available.
I/din     (30449): requestLegend unsuccessful for epoch -1 legend ROADMAP
I/PlatformViewsController(30449): Using hybrid composition for platform view: 0
W/edy     (30449): urls for epoch -1 not available.
I/din     (30449): requestLegend unsuccessful for epoch -1 legend ROADMAP
W/edy     (30449): urls for epoch -1 not available.
I/din     (30449): requestLegend unsuccessful for epoch -1 legend ROADMAP
I/NativeHelper(30449): NativeHelper.ensureLibraryLoaded on thread main
W/dee     (30449): ClientArea created with texture coordinates, but has a non-textured style.
W/cwg     (30449): ScreenPixelGeometryUnpacker int[] getVertices not supported; float-precision would be lost.
E/EGL_emulation(30449): eglQueryContext 32c0  EGL_BAD_ATTRIBUTE
E/EGL_emulation(30449): tid 30449: eglQueryContext(2122): error 0x3004 (EGL_BAD_ATTRIBUTE)
D/HostConnection(30449): createUnique: call
D/HostConnection(30449): HostConnection::get() New Host Connection established 0x7a18e9ad10, tid 30653
D/HostConnection(30449): 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(30449): eglCreateContext: 0x7a18e9a050: maj 3 min 0 rcv 3
D/EGL_emulation(30449): eglMakeCurrent: 0x7a18e9a050: ver 3 0 (tinfo 0x7c3c448280) (first time)
D/EGL_emulation(30449): app_time_stats: avg=1007.38ms min=14.24ms max=27198.86ms count=28
D/EGL_emulation(30449): app_time_stats: avg=16.43ms min=9.83ms max=18.32ms count=61
W/DynamiteModule(30449): Local module descriptor class for com.google.android.gms.googlecertificates not found.
I/DynamiteModule(30449): Considering local module com.google.android.gms.googlecertificates:0 and remote module com.google.android.gms.googlecertificates:7
I/DynamiteModule(30449): Selected remote version of com.google.android.gms.googlecertificates, version >= 7
W/ziparchive(30449): Unable to open '/data/user_de/0/com.google.android.gms/app_chimera/m/00000012/GoogleCertificates.dm': No such file or directory
W/ziparchive(30449): Unable to open '/data/user_de/0/com.google.android.gms/app_chimera/m/00000012/GoogleCertificates.dm': No such file or directory
D/EGL_emulation(30449): app_time_stats: avg=16.60ms min=12.85ms max=19.89ms count=61

@github-actions github-actions bot removed the waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds label May 24, 2023
@darshankawar
Copy link
Member

Thanks for the update and your patience while we try to figure out reason.

W/ziparchive(30449): Unable to open '/data/user_de/0/com.google.android.gms/app_chimera/m/00000012/GoogleCertificates.dm': No such file or directory
W/ziparchive(30449): Unable to open '/data/user_de/0/com.google.android.gms/app_chimera/m/00000012/GoogleCertificates.dm': No such file or directory

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/

@darshankawar darshankawar added the waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds label May 25, 2023
@wonderingdev
Copy link
Author

Thanks for the update and your patience while we try to figure out reason.

W/ziparchive(30449): Unable to open '/data/user_de/0/com.google.android.gms/app_chimera/m/00000012/GoogleCertificates.dm': No such file or directory
W/ziparchive(30449): Unable to open '/data/user_de/0/com.google.android.gms/app_chimera/m/00000012/GoogleCertificates.dm': No such file or directory

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.

@github-actions github-actions bot removed the waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds label May 25, 2023
@darshankawar
Copy link
Member

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
[!] Flutter (Channel stable, 3.10.1, on macOS 12.2.1 21D62 darwin-x64, locale
    en-GB)
    • Flutter version 3.10.1 on channel stable at
      /Users/dhs/documents/fluttersdk/flutter
    ! Warning: `flutter` on your path resolves to
      /Users/dhs/Documents/Fluttersdk/flutter/bin/flutter, which is not inside
      your current Flutter SDK checkout at
      /Users/dhs/documents/fluttersdk/flutter. Consider adding
      /Users/dhs/documents/fluttersdk/flutter/bin to the front of your path.
    ! Warning: `dart` on your path resolves to
      /Users/dhs/Documents/Fluttersdk/flutter/bin/dart, which is not inside your
      current Flutter SDK checkout at /Users/dhs/documents/fluttersdk/flutter.
      Consider adding /Users/dhs/documents/fluttersdk/flutter/bin to the front
      of your path.
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision d3d8effc68 (35 hours ago), 2023-05-16 17:59:05 -0700
    • Engine revision b4fb11214d
    • Dart version 3.0.1
    • DevTools version 2.23.1
    • If those were intentional, you can disregard the above warnings; however
      it is recommended to use "git" directly to perform update checks and
      upgrades.

[!] Xcode - develop for iOS and macOS (Xcode 12.3)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    ! Flutter recommends a minimum Xcode version of 13.
      Download the latest version or update via the Mac App Store.
    • CocoaPods version 1.11.2

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] VS Code (version 1.62.0)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.21.0

[✓] Connected device (5 available)
    • SM G975F (mobile)       • RZ8M802WY0X • android-arm64   • Android 11 (API 30)
    • Darshan's iphone (mobile)  • 21150b119064aecc249dfcfe05e259197461ce23 •
      ios            • iOS 14.4.1 18D61
    • iPhone 12 Pro Max (mobile) • A5473606-0213-4FD8-BA16-553433949729     •
      ios            • com.apple.CoreSimulator.SimRuntime.iOS-14-3 (simulator)
    • macOS (desktop)            • macos                                    •
      darwin-x64     • Mac OS X 10.15.4 19E2269 darwin-x64
    • Chrome (web)               • chrome                                   •
      web-javascript • Google Chrome 98.0.4758.80

[✓] HTTP Host Availability
    • All required HTTP hosts are available

! Doctor found issues in 1 category.

[!] Flutter (Channel master, 3.11.0-13.0.pre.21, on macOS 12.2.1 21D62
    darwin-x64, locale en-GB)
    • Flutter version 3.11.0-13.0.pre.21 on channel master at
      /Users/dhs/documents/fluttersdk/flutter
    ! Warning: `flutter` on your path resolves to
      /Users/dhs/Documents/Fluttersdk/flutter/bin/flutter, which is not inside
      your current Flutter SDK checkout at
      /Users/dhs/documents/fluttersdk/flutter. Consider adding
      /Users/dhs/documents/fluttersdk/flutter/bin to the front of your path.
    ! Warning: `dart` on your path resolves to
      /Users/dhs/Documents/Fluttersdk/flutter/bin/dart, which is not inside your
      current Flutter SDK checkout at /Users/dhs/documents/fluttersdk/flutter.
      Consider adding /Users/dhs/documents/fluttersdk/flutter/bin to the front
      of your path.
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 9e4104b094 (2 hours ago), 2023-05-24 23:09:20 -0400
    • Engine revision 62a83490ee
    • Dart version 3.1.0 (build 3.1.0-143.0.dev)
    • DevTools version 2.23.1
    • If those were intentional, you can disregard the above warnings; however
      it is recommended to use "git" directly to perform update checks and
      upgrades.

[!] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
    • Android SDK at /Users/dhs/Library/Android/sdk
    ✗ cmdline-tools component is missing
      Run `path/to/sdkmanager --install "cmdline-tools;latest"`
      See https://developer.android.com/studio/command-line for more details.
    ✗ Android license status unknown.
      Run `flutter doctor --android-licenses` to accept the SDK licenses.
      See https://flutter.dev/docs/get-started/install/macos#android-setup for
      more details.

[✓] Xcode - develop for iOS and macOS (Xcode 13.2.1)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Build 13C100
    • CocoaPods version 1.11.2

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] IntelliJ IDEA Ultimate Edition (version 2021.3.2)
    • IntelliJ at /Applications/IntelliJ IDEA.app
    • Flutter plugin version 65.1.4
    • Dart plugin version 213.7228

[✓] VS Code (version 1.62.0)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.29.0

[✓] Connected device (3 available)
    • Darshan's iphone (mobile) • 21150b119064aecc249dfcfe05e259197461ce23 • ios
      • iOS 15.3.1 19D52
    • macOS (desktop)           • macos                                    •
      darwin-x64     • macOS 12.2.1 21D62 darwin-x64
    • Chrome (web)              • chrome                                   •
      web-javascript • Google Chrome 109.0.5414.119

[✓] Network resources
    • All expected network resources are available.

! Doctor found issues in 1 category.
      
[!] Xcode - develop for iOS and macOS (Xcode 12.3)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    ! Flutter recommends a minimum Xcode version of 13.
      Download the latest version or update via the Mac App Store.
    • CocoaPods version 1.11.2

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] VS Code (version 1.62.0)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.21.0

[✓] Connected device (5 available)
    • SM G975F (mobile)       • RZ8M802WY0X • android-arm64   • Android 11 (API 30)
    • Darshan's iphone (mobile)  • 21150b119064aecc249dfcfe05e259197461ce23 •
      ios            • iOS 14.4.1 18D61
    • iPhone 12 Pro Max (mobile) • A5473606-0213-4FD8-BA16-553433949729     •
      ios            • com.apple.CoreSimulator.SimRuntime.iOS-14-3 (simulator)
    • macOS (desktop)            • macos                                    •
      darwin-x64     • Mac OS X 10.15.4 19E2269 darwin-x64
    • Chrome (web)               • chrome                                   •
      web-javascript • Google Chrome 98.0.4758.80

[✓] HTTP Host Availability
    • All required HTTP hosts are available

! Doctor found issues in 1 category.



@darshankawar darshankawar added framework flutter/packages/flutter repository. See also f: labels. p: maps Google Maps plugin package flutter/packages repository. See also p: labels. f: integration_test The flutter/packages/integration_test plugin platform-android Android applications specifically has reproducible steps The issue has been confirmed reproducible and is ready to work on found in release: 3.10 Found to occur in 3.10 found in release: 3.11 Found to occur in 3.11 and removed in triage Presently being triaged by the triage team labels May 26, 2023
@darshankawar
Copy link
Member

Would really be great if the Flutter example project is extended with a take screenshot case for Google Maps. Thank you.

@wonderingdev I suggest you to file a new documentation issue so that we can track it properly.

@stuartmorgan stuartmorgan added the P2 Important issues not at the top of the work list label May 30, 2023
@stuartmorgan
Copy link
Contributor

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.

@stuartmorgan stuartmorgan added the a: platform-views Embedding Android/iOS views in Flutter apps label May 30, 2023
@stuartmorgan
Copy link
Contributor

@johnmccutchan FYI; this may be a platform view issue in general (although we haven't validated that yet).

@wonderingdev
Copy link
Author

wonderingdev commented Jun 2, 2023

@darshankawar @stuartmorgan By the way, takeScreenshot works perfectly fine on iOS (tested on iPhone 14 Pro Max emulator). So the problem seems to exist only for Android devices / emulators. Thank you for looking into it! 🚀

@flutter-triage-bot flutter-triage-bot bot added multiteam-retriage-candidate team-android Owned by Android platform team triaged-android Triaged by Android platform team labels Jul 8, 2023
@johnmccutchan johnmccutchan self-assigned this Sep 28, 2023
@nmfisher
Copy link

I'm experiencing similar hangs on a physical Android device at the call to binding.convertFlutterSurfaceToImage. No issue on a physical iOS device.

@flutter-triage-bot flutter-triage-bot bot added the Bot is counting down the days until it unassigns the issue label Feb 8, 2024
@flutter-triage-bot
Copy link

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!

@johnmccutchan
Copy link
Contributor

@jonahwilliams Any idea what could be going on here?

@flutter-triage-bot flutter-triage-bot bot removed the Bot is counting down the days until it unassigns the issue label Feb 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
a: platform-views Embedding Android/iOS views in Flutter apps f: integration_test The flutter/packages/integration_test plugin found in release: 3.10 Found to occur in 3.10 found in release: 3.11 Found to occur in 3.11 framework flutter/packages/flutter repository. See also f: labels. has reproducible steps The issue has been confirmed reproducible and is ready to work on p: maps Google Maps plugin P2 Important issues not at the top of the work list package flutter/packages repository. See also p: labels. platform-android Android applications specifically team-android Owned by Android platform team triaged-android Triaged by Android platform team
Projects
None yet
Development

No branches or pull requests

7 participants