title: How to use Google Maps API v2 with API level 10?
body: <p>According to <a href="https://i.stack.imgur.com/alk9D.png" rel="nofollow noreferrer">1</a> the code posted there can be used for Android API 12 or later. I tried the code on an emulator having API level 10 (Google API platform 2.3.3) and I get the following famous error: <br><br></p>
  
  <p><code>E/AndroidRuntime(  429): java.lang.RuntimeException: Unable to start activity     ComponentInfo{com.example..../com.example....MainActivity}: android.view.InflateException: Binary XML file line #7: Error inflating class fragment</code></p>
  
  <p>I copy-paste my .xml file below. </p>
  
  <pre><code>&lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
  xmlns:tools="http://schemas.android.com/tools"
  android:layout_width="match_parent"
  android:layout_height="match_parent"
  tools:context=".MainActivity" &gt;
  
  &lt;fragment xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/map"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    class="com.google.android.gms.maps.MapFragment"/&gt;
  </code></pre>
  
  <p></p>
  
  <p>So I assume the fragment element is not supported...(?). I tried the same code in an emulator with API level 17 and I get that message (which as I am reading is currently an issue of the emulator):</p>
  
  <pre><code>This app won't run unless you update Google Play Services.
  </code></pre>
  
  <p>I do not have a real device having level 17 to test it, but I assume that it might work. </p>
  
  <p>Do I have any mistake in the above code specifically for level 10? What is the code currently supported by Google, in order to develop maps in an android device with API level 10?</p>
  
  <p><a href="https://i.stack.imgur.com/alk9D.png" rel="nofollow noreferrer">1</a> <a href="https://developers.google.com/maps/documentation/android/start" rel="nofollow noreferrer">https://developers.google.com/maps/documentation/android/start</a></p>
  
  <p>UPDATE:
  After changing to <code>FragmentActivity</code> and <code>SupportMapFragment</code> I get the following: </p>
  
  <p><code>W/dalvikvm( 6718): Unable to resolve superclass of Lmaps/a/du; (406)</code><br>
  <code>W/dalvikvm( 6718): Link of class 'Lmaps/a/du;' failed</code><br>
  <code>W/dalvikvm( 6718): Unable to resolve superclass of Lmaps/a/ej; (2358)</code><br>
  <code>W/dalvikvm( 6718): Link of class 'Lmaps/a/ej;' failed</code><br>
  <code>W/dalvikvm( 6718): Unable to resolve superclass of Lmaps/j/k; (2374)</code><br>
  <code>W/dalvikvm( 6718): Link of class 'Lmaps/j/k;' failed</code> <br>
  <code>E/dalvikvm( 6718): Could not find class 'maps.j.k', referenced from method maps.
  y.ae.a</code><br>
  <code>W/dalvikvm( 6718): VFY: unable to resolve new-instance 3566 (Lmaps/j/k;) in Lmap
  s/y/ae;</code><br>
  <code>D/dalvikvm( 6718): VFY: replacing opcode 0x22 at 0x007d</code><br>
  <code>D/dalvikvm( 6718): VFY: dead code 0x007f-008f in Lmaps/y/ae;.a(Landroid/view/LayoutInflater;Lcom/google/android/gms/maps/GoogleMapOptions;Z)Lmaps/y/ae;</code><br></p>
  
  <p>And after 2 seconds:<br>
  <code>Google Maps Android API Authorization failure</code></p>
  
  <p>UPDATE 2:
  I changed the project to build target for android 10 (I had it for android 4.2). So now I do not see the authorization failure). I also paste my api accesses from google <img src="https://i.stack.imgur.com/alk9D.png" alt="api accesses">. </p>
  
  <p>I do not have proguard enabled in my .properties of the project i.e.,:<br> 
  <code># To enable ProGuard to shrink and obfuscate your code, uncomment this (available     properties: sdk.dir, user.home):</code>
  <code>#proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt</code></p>
  
  <p><code># Project target.</code><br>
  <code>target=android-10</code><BR>
  <code>android.library.reference.1=../../adt-bundle-windows-x86/sdk/extras/google/google_play_services/libproject/google-play-services_lib</code></p>
  
  <p>The problem still remains:</p>
  
  <p><code>01-12 09:57:36.306: D/dalvikvm(9072): DexOpt: couldn't find field Landroid/content/res/Configuration;.smallestScreenWidthDp</code><br>
  <code>01-12 09:57:36.306: W/dalvikvm(9072): VFY: unable to resolve instance field 24</code><br>
  <code>01-12 09:57:36.306: D/dalvikvm(9072): VFY: replacing opcode 0x52 at 0x0012</code><br>
  <code>01-12 09:57:36.306: D/dalvikvm(9072): VFY: dead code 0x0014-0018 in Lcom/google/android/gms/common/GooglePlayServicesUtil;.b (Landroid/content/res/Resources;)Z</code><br>
  <code>01-12 09:57:36.326: W/dalvikvm(1914): disableGcForExternalAlloc: false</code><br>
  <code>01-12 09:57:36.446: D/dalvikvm(9072): GC_CONCURRENT freed 186K, 45% free 3135K/5639K, external 0K/0K, paused 3ms+2ms</code><br>
  <code>01-12 09:57:36.476: W/dalvikvm(9072): Unable to resolve superclass of Lmaps/a/du; (406)</code><br>
  <code>01-12 09:57:36.476: W/ResourceType(7905): getEntry failing because entryIndex 303 is beyond type entryCount 133</code><br>
  <code>01-12 09:57:36.476: W/ResourceType(7905): Failure getting entry for 0x7f02012f (t=1 e=303) in package 0 (error -2147483647)</code><br>
  <code>01-12 09:57:36.476: W/ResourceType(7905): getEntry failing because entryIndex 827 is beyond type entryCount 133</code><br>
  <code>01-12 09:57:36.476: W/dalvikvm(9072): Link of class 'Lmaps/a/du;' failed</code><br>
  <code>01-12 09:57:36.476: W/dalvikvm(9072): Unable to resolve superclass of Lmaps/a/ej; (2358)</code><br>
  <code>01-12 09:57:36.476: W/dalvikvm(9072): Link of class 'Lmaps/a/ej;' failed</code><br>
  <code>01-12 09:57:36.476: W/dalvikvm(9072): Unable to resolve superclass of Lmaps/j/k; (2374)</code><br>
  <code>01-12 09:57:36.476: W/dalvikvm(9072): Link of class 'Lmaps/j/k;' failed</code><br>
  <code>01-12 09:57:36.486: E/dalvikvm(9072): Could not find class 'maps.j.k', referenced from method maps.y.ae.a</code><br>
  <code>01-12 09:57:36.486: W/dalvikvm(9072): VFY: unable to resolve new-instance 3566 (Lmaps/j/k;) in Lmaps/y/ae;</code><br>
  <code>01-12 09:57:36.486: D/dalvikvm(9072): VFY: replacing opcode 0x22 at 0x007d</code><br>
  <code>01-12 09:57:36.496: D/dalvikvm(9072): VFY: dead code 0x007f-008f in Lmaps/y/ae;.a (Landroid/view/LayoutInflater;Lcom/google/android/gms/maps/GoogleMapOptions;Z)Lmaps/y/ae;</code><br>
  <code>01-12 09:57:36.546: I/keystore(1270): uid: 1000 action: e -&gt; 7 state: 3 -&gt; 3 retry: 4</code><br>
  <code>01-12 09:57:36.556: I/keystore(1270): uid: 1000 action: e -&gt; 7 state: 3 -&gt; 3 retry: 4</code><br>
  <code>&lt;01-12 09:57:36.576: W/ResourceType(7905): Failure getting entry for 0x7f02033b (t=1 e=827) in package 0 (error -2147483647)</code><br>
  <code>01-12 09:57:36.576: V/WindowManager(1369): Finished animation in AppWindowToken{410a0930 token=HistoryRecord{4099f2f0 com.example..../.MainActivity}} @ 20019326</code><br>
  <code>01-12 09:57:36.596: W/ResourceType(7905): getEntry failing because entryIndex 303 is beyond type entryCount 133</code><br>
  <code>01-12 09:57:36.616: W/ResourceType(7905): Failure getting entry for 0x7f02012f (t=1 e=303) in package 0 (error -2147483647)</code><br>
  <code>01-12 09:57:36.616: W/ResourceType(7905): getEntry failing because entryIndex 827 is beyond type entryCount 133</code><br>
  <code>01-12 09:57:36.616: W/ResourceType(7905): Failure getting entry for 0x7f02033b (t=1 e=827) in package 0 (error -2147483647)</code><br>
  <code>01-12 09:57:36.686: D/dalvikvm(9072): GC_CONCURRENT freed 276K, 45% free 3257K/5895K, external 0K/0K, paused 4ms+9ms</code><br>
  <code>01-12 09:57:36.876: I/keystore(1270): uid: 1000 action: e -&gt; 7 state: 3 -&gt; 3 retry: 4</code><br>
  <code>01-12 09:57:37.026: D/ATRecorder(9072): com.htc.autotest.dlib.RecordEngine in loader dalvik.system.DexClassLoader@405d2328</code><br>
  <code>01-12 09:57:37.046: D/WindowManagerImpl(9072): addView, new view, mViews[0]: com.android.internal.policy.impl.PhoneWindow$DecorView@405220f0</code><br>
  <code>01-12 09:57:37.056: I/keystore(1270): uid: 1000 action: e -&gt; 7 state: 3 -&gt; 3 retry: 4</code><br>
  <code>01-12 09:57:37.117: D/PhoneApp(1491): EVENT_QUERY_MO_PACKAGES</code><br>
  <code>01-12 09:57:37.137: D/libEGL(9072): loaded /system/lib/egl/libGLES_android.so</code><br>
  <code>01-12 09:57:37.147: D/WindowManagerImpl(1369): finishRemoveViewLocked, mViews[1]: com.android.internal.policy.impl.PhoneWindow$DecorView@40957078</code><br>
  <code>01-12 09:57:37.147: I/ActivityManager(1369): Displayed com.example..../.MainActivity: +931ms</code><br>.
  <code>01-12 09:57:37.147: W/SchedPolicy(9072): add_tid_to_cgroup failed to write '' (Invalid argument); background=0</code><br>
  <code>01-12 09:57:37.157: D/libEGL(9072): loaded /system/lib/egl/libEGL_adreno200.so</code><br>
  <code>01-12 09:57:37.157: W/InputManagerService(1369): [unbindCurrentClientLocked] Disable input method client.</code><br>
  <code>01-12 09:57:37.157: W/InputManagerService(1369): [startInputLocked] Enable input method client.</code><br>
  <code>01-12 09:57:37.187: D/libEGL(9072): loaded /system/lib/egl/libGLESv1_CM_adreno200.so</code><br></p>