“Error inflating class fragment” with google map

前端 未结 10 1933
有刺的猬
有刺的猬 2020-12-01 09:29

I tried to make a sample project using Google Map, but I couldn\'t. Help me please!

Test Device : Android 4.0.4


Error Message :

12-2         


        
10条回答
  •  生来不讨喜
    2020-12-01 10:22

    You are extending FragmentActivity, indicating that you are trying to use the Android Support package backport of fragments. However, your element refers to MapFragment, which is for the native API Level 11 edition of fragments.

    Replace MapFragment with SupportMapFragment, and that should clear up this specific crash.

提交回复
热议问题