1

Estoy ejecutando una aplicación creada en Xamarin, pero en la linea de:

setContentView(Resource.Layout.Main);

Me marca el siguiente error:

Android.Views.InflateException: Binary XML file line #1: Binary XML file line #1: Error inflating class fragment

Este es mi layout:

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent">
<fragment
    android:id="@+id/googlemap"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:name="com.google.android.gms.maps.mapfragment" />
</LinearLayout>

Creo que el problema está ahí, pero no logro identificarlo, es la primera vez que ocupo fragment.

A qué se refiere el error InflateException??

ACTUALIZADO: Este es mi Main Activity:

    protected override void OnCreate(Bundle bundle)
    {
        base.OnCreate(bundle);

        // Set our view from the "main" layout resource
        SetContentView(Resource.Layout.Main);
    }

y esta es la salida del Output:

Unhandled Exception:

Android.Views.InflateException: <Timeout exceeded getting exception details>

An unhandled exception occured.

1 respuesta 1

0

Debes usar com.google.android.gms.maps.SupportMapFragment

Cambia tu layout , debería quedar así :

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent">
<fragment
    android:id="@+id/googlemap"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:name="com.google.android.gms.maps.SupportMapFragment" />
</LinearLayout>
8
  • Muchas gracias por tu respuesta, modifiqué mi layout pero ahora me aparece: "Android.Views.InflateException: <Timeout exceeded getting exception details>"
    – EriK
    el 6 dic. 2017 a las 22:41
  • Puedes poner el log completo y tambien tu Activity en tu pregunta el 6 dic. 2017 a las 22:42
  • Listo, ya lo puse :)
    – EriK
    el 6 dic. 2017 a las 22:59
  • Al parecer no has importado la libreria de maps en tu proyecto el 6 dic. 2017 a las 23:01
  • Adjunté una imagen de mis referencias
    – EriK
    el 6 dic. 2017 a las 23:04

Tu Respuesta

Al pulsar en “Publica tu respuesta”, muestras tu consentimiento a nuestros términos de servicio, política de privacidad y política de cookies

¿No es la respuesta que buscas? Examina otras preguntas con la etiqueta o formula tu propia pregunta.