We have recently started expanding our UI testing suite and have started to incorporate some tests that involve Google's FusedLocationProviderClient.
In particular one of our tests involves showing a different carousel when the user is within 30km of a location. Since this is achieved using a use case IsUserLocal
we have mocked this use case so that, regardless of the location from the FusedLocation, it always returns true.
Unfortunately, however, our LocationRequest callback never returns a value when the tests are run on Firebase Test Lab (FTL). When I run the same test on an emulator or a real device it works as expected. We have also noticed that Google maps are always blank in the videos on FTL too. So I suspect that all the Location APIs are not working on FTL.
I'd read that this could be because FTL re-signs the apk but I've tried various things with our GoogleMaps API key - such as not restricting it, adding the service account key to it, adding the production Google generated key to the debug package that our test APK is built on but we still see blank Google Maps and a failing test.
Is it possible to get the location services working properly on Firebase, and if so, how?
Another thing I've noticed is that the log file will have messages such as:
09-19 07:25:24.008: W/MobStoreFlagStore(2940): java.util.concurrent.ExecutionException: java.lang.SecurityException: GoogleCertificatesRslt: not allowed: pkg={my package}, sha256={my sha256}, atk=false, ver=232617037.true (go/gsrlt)
But {my package} is already associated with the sha1 token related to {my sha256} in the Google console.