Google Maps v2 not loading. Error android.view.InflateException: Binary XML file line.. Error inflating class fragment

☆樱花仙子☆ 提交于 2019-11-29 17:57:33

mention this meta data tag

  <meta-data
        android:name="com.google.android.gms.version"
        android:value="@integer/google_play_services_version" />

remove open gls tan andand let me know the result

try this one

<fragment
    android:id="@+id/map"
    android:name="com.google.android.gms.maps.SupportMapFragment"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"/>

You can use

mMap = ((SupportMapFragment) getSupportFragmentManager().findFragmentById(R.id.your_id))
            .getMap();

From xml

<fragment
android:id="@+id/your_id"
android:name="com.google.android.gms.maps.SupportMapFragment"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"/>

Add your key here

 android:value="(MY API KEY)"
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!