Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 75885

Xamarin.Forms.Maps 2.0.0.6484 hangs or crashes on Android

$
0
0

Hi,

I have a question concerning the new Xamarin.Forms 2.0.x version especially the Xamarin.Forms.Maps dll.
After updating to Xamarin 4 with the new Xamarin.Forms and Xamarin.Forms.Maps version 2.0.x my Xamarin.Forms App using the Maps control just hangs navigating to the page with the map control.
It does not crash, it runs thru the initialization code and the constructor but the page does not appear.
After temp. deleting the map control from the page the page appears normal and works as expected.

I am using the current Xamarin Studio in beta version and the Xamarin Forms dll (forms and map) with version 2.0.0.6484.
I updated all GooglePlayService dll except the Xamarin.GooglePlayServices.Maps dll which stuck at version 26.0.0.0 because the Forms dll are built against it.

So I planed to make a very simple Xamarin Forms test app, just with the map control. (like this)

public class App : Application
{
    public App ()
    {

        MainPage = new ContentPage 
        { 
            Content = new Map (MapSpan.FromCenterAndRadius (new Position (37, -122), Distance.FromMiles (10)))
        };  
    }

On iOS it just simple shows the Map.

On Android it crashes with this error:

Java.Lang.NoSuchMethodError exception was thrown:
com.google.android.gms.maps.MapView$zzb.zzrn

I tested it with a valid Google Maps API key (here xxx ed out):

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionCode="1" android:versionName="1.0" package="com.developeit.mapsample">
    <uses-sdk android:minSdkVersion="16" />
    <application android:label="MapSample.Droid">
        <meta-data android:name="com.google.android.maps.v2.API_KEY" android:value="AIzaSyCJxxxxxxxxxxxx" />
        <meta-data android:name="com.google.android.gms.version" android:value="@integer/google_play_services_version" />
    </application>
    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES" />
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
    <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
    <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
    <uses-permission android:name="android.permission.ACCESS_LOCATION_EXTRA_COMMANDS" />
    <uses-permission android:name="android.permission.ACCESS_MOCK_LOCATION" />
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
    <uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
</manifest>

On the simulator the page should be shown with the message that the GooglePlay Services has to be installed. But I also tested it on a real device and it crashes also.

I opened up and old App of me using the same Google API key which I do not want to update. I uses GooglePlayServices version 21.0.0.1 and Xamarin.Forms.Maps 1.2.3.6257...and the page with the map control appears with the message to install GooglePlayServices in the simulator. It works on the device.

So my question is:

Does anyone else do have this problem with the new Xamarin.Forms.Maps version 2.0.x DLL ?
Do I make a simple mistake ? (I mean the sample app is extremely simple).

Any ideas ?

Thank you for your help

Marco


Viewing all articles
Browse latest Browse all 75885

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>