All my apps start failing when I add google maps

I added Google maps to an existing Xamarin.Forms app and when I deploy it to Android device stops working when loading the View with the map.
I even tried the sample WorkingWithMaps - this also fails.
I followed the procedure step by step, and added my API Key.
Thanks for help.

Best Answer

Answers

  • ChristopheBERNARDChristopheBERNARD BEMember ✭✭✭✭

    Hello @vikrama_5
    try to add the permission internet to your manifest

  • LeonLuLeonLu Member, Xamarin Team Xamurai

    Due to I cannot reproduce your issue, can you provide a demo that could reproduce this issue?

  • vikrama_5vikrama_5 Member ✭✭
    edited August 9

    Hello thanks for your answers - here is the link to the repo:
    I cannot paste a link so its on github: vikramjhurry/Gmaps_PoC
    The last menu option opens the view for loading gmaps. The app loads but only when loading this view it fails.

  • vikrama_5vikrama_5 Member ✭✭

    I have added internet permission .

  • vikrama_5vikrama_5 Member ✭✭
    edited August 9

    Maybe my description of problem is a bit misleading: here is my issue: I basically want to add GMaps to an existing app.
    I created a new view (MapsPagexaml.xaml), and I added my Google maps Sdk api key to the manifest. The app loads normally but crashes when I select the menu to open the new view.
    So I tried to just download the Xamarin WorkingwithMaps sample and build it and archive it and launch it on my Android (version 9) - this behaves exactly the same way as my app - it crashes just when map needs to load.
    All the permissions are there - u can check in manifest.

  • vikrama_5vikrama_5 Member ✭✭

    So I emulate it on VStudio - when map needs to load I get an exception Unhandled Exception:

    Java.Lang.SecurityException: occurred.

  • ChristopheBERNARDChristopheBERNARD BEMember ✭✭✭✭
    edited August 9

    @vikrama_5
    which version of android do you target .. marsmallow ?
    check added permissioni as this
    uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"
    uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"

    looks on youtube there are a lot of sample

  • vikrama_5vikrama_5 Member ✭✭

    Thnaks for the youtube link. Im having a look

  • JohnHardmanJohnHardman GBUniversity mod

    @vikrama_5

    Can you access Google maps from a browser on your device?

  • vikrama_5vikrama_5 Member ✭✭

    @JohnHardman yes I can access google maps both from browser and gmaps app.

  • vikrama_5vikrama_5 Member ✭✭

    I attached the output messages log for convenience.

  • JohnHardmanJohnHardman GBUniversity mod

    @vikrama_5 said:
    I attached the output messages log for convenience.

    Have you Googled the various log messages around the point where the unhandled exception occurred?

    The first one I checked returned this thread, which contains various possibilities:
    https://stackoverflow.com/questions/37281942/google-map-api-v2-shows-v-googlesignatureverifier-signature-not-valid-error

  • vikrama_5vikrama_5 Member ✭✭

    @LeonLu said:
    @vikrama_5 I downloaded your project, create a new Contentpage in your project.

    First of all, I cannot run your project directly, I have to enable the Muti-Dex

    And Unsign the .APK file using the following keystore details

    I can show the Google map in your project.

    I upload my project, your can refer to it.

    Yes , the map loads in the attached project - thanks - I am looking into it.
    The error - it seems is the signing key - I have to take my signing key and use it to generate the API key in google developer console.

  • LeonLuLeonLu Member, Xamarin Team Xamurai

    @vikrama_5 Yes, you have to sign the key for google maps.If the issue was solved, please mark the helpful reply as an answer, it will help others who have similar issue.

Sign In or Register to comment.