I am trying to follow the Maps API guide, but I've had this error for a while. I already tried:
This is my xml code
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent">
<fragment xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/gmap"
android:layout_width="match_parent"
android:layout_height="match_parent"
class = "com.google.android.gms.maps.MapFragment"
/>
</LinearLayout>
And this is my main activity
[Activity(Label = "@string/app_name", MainLauncher = true)]
public class MainActivity : AppCompatActivity, IOnMapReadyCallback
{
protected override void OnCreate(Bundle savedInstanceState)
{
base.OnCreate(savedInstanceState);
SetContentView(Resource.Layout.activity_main);
var mapFragment = (MapFragment)FragmentManager.FindFragmentById(Resource.Id.gmap);
mapFragment.GetMapAsync(this);
}
public void OnMapReady(GoogleMap map)
{
// Do something with the map, i.e. add markers, move to a specific location, etc.
// Set up a normal map
map.MapType = GoogleMap.MapTypeHybrid;
// Map settings
map.UiSettings.ZoomControlsEnabled = true;
map.UiSettings.CompassEnabled = true;
}
}
}