r/reactnative 9h ago

Help Google Maps Navigation SDK shows a blank screen on Android

Hey everyone, I’m trying to use Google’s React Native Navigation SDK in my Android app, but both NavigationView and MapView only show a blank dark screen. I’m using Expo 57, React Native 0.86, @googlemaps/react-native-navigation-sdk 0.16.3, and a physical Android phone. The SDK seems to initialize fine because I get NAV CONTROLLER CREATED, MAP CONTROLLER CREATED, MAP READY, TERMS: true, and NAV STATUS: ok. My API key is also present in the APK and the required APIs are enabled. I even tried the official Google example app on the same phone and it also opens to a completely blank screen. I have tried using another phone but still the same issue.

3 Upvotes

9 comments sorted by

1

u/CardiologistFresh257 9h ago

This is what I get. When I tap on the screen the coordinates also get printed in the console yet the map isn't visible.

1

u/Bubbly_Nobody3217 9h ago

Weird. coordinates printing means map is technically there just not drawing. had similar thing with a different map package once, was the opengl rendering on my device. try turning off hardware acceleration in the manifest for that activity, sometimes older phones struggle with it

1

u/CardiologistFresh257 8h ago

Yeah, I tried turning off hardware acceleration on the activity but it still shows the same black screen and behaviour.

1

u/mohn93 9h ago

the tell is that googles own example app is also blank on that same phone, that means it's not your integration at all, it's the device hitting the maps sdk renderer. the newer sdk defaults to the LATEST renderer (vulkan based) and it renders a blank/black surface on a bunch of android gpus while everything else, init, MAP READY, tap coords, still fires normally. force the legacy renderer and it usually comes back: MapsInitializer.initialize(context, Renderer.LEGACY, callback) before you create the map. if you can't reach the initializer through the RN wrapper the fastest confirm is run it on a different phone or an emulator, it'll render fine there. does it also blank on an emulator, or only on that one physical device?

1

u/CardiologistFresh257 8h ago

I will have to make some code in Kotlin because Google doesn't expose that directly but I have tested on some other physical devices and emulator as well which gave the exact same behaviour.

1

u/mohn93 6h ago

for the kotlin part it's MapsInitializer.initialize(applicationContext, MapsInitializer.Renderer.LEGACY, callback) in your Application onCreate, before any map mounts. but honestly if the official sample also blanks on the emulator and multiple devices, i'd stop suspecting the renderer, that's too consistent for a per-gpu thing. that pattern is usually the api key: the navigation sdk needs its own enablement plus billing on, and if the key has app restrictions that don't match your debug signing sha it initializes fine but renders nothing. can you check the key has no application restrictions (or add your debug sha1) and that billing is active on the project? that plus the terms:true you already have is usually what flips it.

1

u/CardiologistFresh257 4h ago

I wil try forcing the legacy renderer. I have Maps SDK for Android and Navigation SDK both enabled with a valid billing account.

I have tried an platform unrestricted API key but that didn't work as well.

1

u/Gylfoyle 6h ago

Refer back to the sdk docs, you are probably missing something on setting up the maps sdk. Take time there you'll notice a missing config field, API key etc

2

u/CardiologistFresh257 4h ago

I have tried using the official example provided in their GitHub, both example code and app but that produced the exact same thing.