Blank screen google maps on UI test xamarin android


Blank screen google maps on UI test xamarin android



I write Ui test for Xamarin Forms project, with use google map on iOS they work normal, but on android show only blank screen.
If build on debug / release or install apk maps work, but if i use UI test nothing. I use Nunit 2.6.4 and testing on local device and emulator and AppCenter.





It could be a keystore issue, are you sending the keystore information when you start the app in UITest? I've seen this cause issues with Google maps before.
– Owen Niblock
Jun 28 at 19:20





No, what can i do this?
– Alex Heal
Jun 29 at 11:07





developer.xamarin.com/api/member/… <-- details are here. If that's it, let me know and I'll write up an answer for future users :-)
– Owen Niblock
Jun 29 at 17:30





Yea, thanks so match, this help me, now google maps work on local emulator, but on AppCenter nothing has changed. I use Google pixel device set, not absolute path like "../../../appname.apk" and on config keystore to. Mb AppCenter hasn't support google play api on android?
– Alex Heal
Jun 29 at 20:50






Yeah, you'll have to also send the keystore with the appcenter-cli when you send it to App Center :) Let me write up a proper answer!
– Owen Niblock
Jun 29 at 21:05




1 Answer
1



Why this issue exists



When you're compiling your .apk with Google Maps included, Maps use your Keystore settings to verify that the maps is legit (I can't remember the exact details off hand but basically - if the keystore information used to sign the .apk changes - it breaks the maps).



By default, when you use UITest without sending keystore information - UITest does various magical things with its own keystore. This causes maps to stop working.



How to resolve this locally



To fix the test run locally, you need to tell UITest to use the keystore which you used to build the .apk file originally:


public AndroidAppConfigurator KeyStore (String path, String storePassword, String keyPassword, String keyAlias)



Is the method you want to use when setting up your App Configuration:


ConfigureApp
.Android
.ApkFile("path/to/my.apk")
.Keystore(path, password, alias)
.StartApp(mode);



How to resolve this in App Center



If you want to send your tests up to App Center then you'll need to do one more thing - and that is to include the keystore information when calling the appcenter-cli using the following parameters (which you can get from appcenter test run uitest --help:


appcenter-cli


appcenter test run uitest --help


--key-password <arg> Password to the matching private
key in the keystore. Corresponds
to the "-keypass" argument in
jarsigner
--key-alias <arg> Alias to the key in the keystore.
Corresponds to the "-alias"
argument in jarsigner
--store-password <arg> Password to the keystore.
Corresponds to the "-storepass"
argument in jarsigner
--store-path <arg> Path to the keystore file



P.S. If you have issues with App Center - I'd recommend opening a conversation using the Intercom widget in the bottom corner of the website - this will get you routed through to the Test support team who should be able to help you (you might even get to speak to me! :))






By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Comments

Popular posts from this blog

paramiko-expect timeout is happening after executing the command

Possible Unhandled Promise Rejection (id: 0): ReferenceError: user is not defined ReferenceError: user is not defined

Opening a url is failing in Swift