0

After migrating androidX getting this error

   <fragment
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:name="com.google.android.gms.maps.SupportMapFragment"/>

Caused by: android.view.InflateException: Binary XML file line #39: Error inflating class fragment Caused by: androidx.fragment.app.Fragment$InstantiationException: Unable to instantiate fragment com.google.android.gms.maps.SupportMapFragment: calling Fragment constructor caused an exception

Ramesh R
  • 7,009
  • 4
  • 25
  • 38

1 Answers1

2

You have to use a SupportMapFragment migrated from Android Support Libraries to AndroidX Libraries.

In you case use this version or later.

com.google.android.gms:play-services-maps:17.0.0

If you check the doc it extends androidx.fragment.app.Fragment.

Gabriele Mariotti
  • 320,139
  • 94
  • 887
  • 841