0

I have a basic flutter app to which I've added google_maps_flutter:

https://bitbucket.org/ne-paul/fmtmaptest/src/master/

using the instructions from here:

https://pub.dev/packages/google_maps_flutter

I can only get it to work on one Android simulator (Galaxy Nexus API R). I've also tried it on Pixel 2 API 30 simulator, an Alba 4 phone with Android 7 Noughat and a Samsung A20e with Android 10. With everything, other than the Galaxy simulator, I get a black screen:

Pixel (left) and Galaxy Simulator Details

The only relevant thing I can see in the log is this, but I'm not sure it's an issue:

Running Gradle task 'assembleDebug'... Done                         2.5s
✓ Built build/app/outputs/apk/debug/app-debug.apk.
W/DynamiteModule(14762): Local module descriptor class for com.google.android.gms.googlecertificates not found.
I/DynamiteModule(14762): Considering local module com.google.android.gms.googlecertificates:0 and remote module com.google.android.gms.googlecertificates:4
I/DynamiteModule(14762): Selected remote version of com.google.android.gms.googlecertificates, version >= 4

Having googled, I've checked that the API Key has the Android Maps SDK enabled and I am now at a loss to the cause.

Paul Grenyer
  • 1,713
  • 3
  • 30
  • 51
  • Have you connected the suspect devices and inspected logcat? – Luke Alderton Jun 18 '20 at 14:48
  • Not yet, I don't have any of the devices and those with them aren't technical. I'll get my hands on one. The log from the simulator isn't giving any obvious clues, but I'll add it to the description. – Paul Grenyer Jun 18 '20 at 15:03

2 Answers2

0

Partial answer, I am using AppCenter and when I did a build the API key wasn't getting into the build correctly. A local build build with the API key hard coded fixed the issue on mobile.

Still no idea why it works on some simulators and not others.

Paul Grenyer
  • 1,713
  • 3
  • 30
  • 51
0
  1. Check if your api key is working.

  2. Wrap with Widget as given below to stop google map showing black screen when reload.

    return SingleChildScrollView(
       physics: const NeverScrollableScrollPhysics(),
       child:SizedBox(
         width: MediaQuery.of(context).size.width,
         height: MediaQuery.of(context).size.height,
         child: //Your GoogleMap here,
       ),
     );
    
Deekshith Xetty
  • 224
  • 3
  • 11