Binary XML file line #8: Error inflating class fragment, Google Maps

前端 未结 5 2007
醉酒成梦
醉酒成梦 2021-01-12 07:48

In this app, I am trying to add a functional V2 google map. I\'ve looked at most of the tutorials for creating an activity, obtaining a key for the maps, and creating the xm

5条回答
  •  死守一世寂寞
    2021-01-12 08:02

    I am trying to deploy Google Play Services V2 (for Google Map functionalities) on Android 2.3.4. (API level 10), I had the same problem. Here is how I solved it:

    1. google-play-services_lib had to be included as a library. In Eclipse, you can do this as follows:

      • Use the Android SDK Manager to download the library.
      • Create a new Android Project from existing code where you point to google-play-services_lib in the folder you used to install the SDK. I used one level up (libproject).
      • Under Project -> Properties -> Android flag this project as Is library.
      • In your project, also open Project -> Properties -> Android and click on Add in the library section. Select the google-play-services_lib. It will appear as com_google_android_gms.

      This is important: please ensure the project build target for the library is the same as the one used for your app.

    2. Because the API version is beneath 11, SupportMapFragment is used instead of MapFragment.

    Hope this helps. It has taken me at least three solid hours to work this one out.

提交回复
热议问题