I'm trying to add Google Maps v2 to an Mvx project by combining the Monodroid MapsAndLocationDemo_v2 with the N=26 Fraggle demo from NPlus1DaysOfMvvmCross.
I have added Google Play services to the Maps demo and am successfully displaying a map using:
<fragment xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/map"
android:layout_width="match_parent"
android:layout_height="match_parent"
class="com.google.android.gms.maps.SupportMapFragment" />
With the Fraggle demo, the same fragment causes an Android.Views.InflateException error.
I have followed the same steps to add Google Play services to both projects, and am using the same AndroidManifest.xml file in both projects
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.demo.app" android:installLocation="auto" android:versionCode="1" android:versionName="1">
<uses-sdk android:minSdkVersion="8" android:targetSdkVersion="17" />
<application android:label="Demo"></application>
<uses-feature android:glEsVersion="0x00020000" android:required="true" />
<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_NETWORK_STATE" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="com.demo.app.permission.MAPS_RECEIVE" />
<permission android:name="com.demo.app.permission.MAPS_RECEIVE" android:protectionLevel="signature" />
<meta-data android:name="com.google.android.maps.v2.API_KEY" android:value="AAAAAAAAAAAAAAAAA-xxxxxxxxxxxxxxxxxxxxxx" />
</manifest>
Other than adding the fragment and updating the manifest, there are no changes to the Fraggle demo code. The working view from the Maps demo is
namespace SimpleMapDemo
{
using Android.App;
using Android.OS;
using Android.Support.V4.App;
[Activity(Label = "@string/basic_map")]
public class BasicDemoActivity : FragmentActivity
{
protected override void OnCreate(Bundle bundle)
{
base.OnCreate(bundle);
SetContentView(Resource.Layout.BasicDemo);
}
}
}
and the view from the Mvx version is:
using Android.App;
using Android.OS;
using Cirrious.MvvmCross.Droid.Fragging;
using Rock.Core.ViewModels;
namespace Rock.Droid.Views
{
[Activity(Label = "View for FirstViewModel")]
public class FirstView : MvxFragmentActivity
{
protected override void OnCreate(Bundle bundle)
{
base.OnCreate(bundle);
SetContentView(Resource.Layout.FirstView);
}
}
}
I've also tried referencing the Google Play services dll from the working demo, and have the same results.