title: Google Maps Android API v2 - simple map app crashes
body: <p>I'm new to android dev :)</p>
  
  <p>I'm trying to create a simple app: an activity with a map.
  I connected my HTC 1x to the computer and when I try to run the app (via intellij IDEA), it crashes.</p>
  
  <p>I have searched for the net (and stackoverflow) for clues and couldn't find any. For example:<br/>
  &nbsp;- <a href="https://stackoverflow.com/questions/14568741/google-maps-v2-error">Google Maps v2 - Error</a><br/>
  &nbsp;- <a href="https://stackoverflow.com/questions/14386631/google-map-runtimeexception-error-inflating-class-fragment/14386980#14386980">google map - runtimeexception - error inflating class fragment</a><br/></p>
  
  <p>Can you please tell me why??</p>
  
  <p>Thanks,</p>
  
  <p><em>Omer</em></p>
  
  <p><br/>
  <br/>
  Tech details:</p>
  
  <pre>
  HTC 1x runs android 4.1.1
  Project External libraries:
   - Android 4.0 Google API's
   - Android-Support-V4.jar
   - google-play-services.jar
  </pre>
  
  <p><br/>
  <br/>
  Main Activity.xml:</p>
  
  <pre>
  &lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
                android:layout_width="fill_parent"
                android:layout_height="fill_parent" >
  &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"
            android:name="com.google.android.gms.maps.SupportMapFragment"/&gt;
  &lt;/LinearLayout>
  </pre>
  
  <p><br/><br/>
  Main Activity.Java</p>
  
  <pre>
  package com.example.mapTest;
  
  import android.os.Bundle;
  import android.support.v4.app.FragmentActivity;
  
  public class MainActivity extends FragmentActivity {
      /**
       * Called when the activity is first created.
       */
      @Override
      public void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.mainActivity);
      }
  }
  </pre>
  
  <p><br/><br/>
  Manifest.xml</p>
  
  <pre>
  &lt;?xml version="1.0" encoding="utf-8"?>
  &lt;manifest xmlns:android="http://schemas.android.com/apk/res/android"
            package="com.example.mapTest"
            android:versionCode="1"
            android:versionName="1.0">
  
      &lt;uses-sdk android:minSdkVersion="14" android:targetSdkVersion="14" />
  
      &lt;uses-feature
              android:glEsVersion="0x00020000"
              android:required="true"/>
  
      &lt;permission
              android:name="com.example.mapTest.permission.MAPS_RECEIVE"
              android:protectionLevel="signature"/>
      &lt;uses-permission android:name="com.example.mapTest.permission.MAPS_RECEIVE"/>
  
      &lt;uses-permission android:name="android.permission.INTERNET"/>
      &lt;uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
      &lt;uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
      &lt;uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES"/>
      &lt;uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>
      &lt;uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
  
      &lt;application android:label="@string/app_name" android:icon="@drawable/ic_launcher">
  
          &lt;meta-data
                  android:name="com.google.android.maps.v2.API_KEY"
                  android:value="AIzaSyAEHaDozQSyWTXl77MpGp6Wtvd5RyteV8Q"/>
  
          &lt;activity android:name="MainActivity"
                    android:label="@string/app_name">
              &lt;intent-filter>
                  &lt;action android:name="android.intent.action.MAIN"/>
                  &lt;category android:name="android.intent.category.LAUNCHER"/>
              &lt;/intent-filter>
          &lt;/activity>
      &lt;/application>
  &lt;/manifest>
  
  </pre>
  
  <p><br/><br/></p>
  
  <p>The exception:</p>
  
  <pre>
  03-19 00:09:30.325: ERROR/NotificationService(434): Ignoring notification with icon==0: Notification(pri=0 contentView=null vibrate=null sound=nullnull defaults=0x0 flags=0x62 kind=[null])
  03-19 00:09:41.430: ERROR/MediaScannerService(13421): Exception scanning file
          android.os.DeadObjectException
          at android.os.BinderProxy.transact(Native Method)
          at android.media.IMediaScannerListener$Stub$Proxy.scanCompleted(IMediaScannerListener.java:100)
          at com.android.providers.media.MediaScannerService$ServiceHandler.handleMessage(MediaScannerService.java:1007)
          at android.os.Handler.dispatchMessage(Handler.java:99)
          at android.os.Looper.loop(Looper.java:155)
          at com.android.providers.media.MediaScannerService.run(MediaScannerService.java:713)
          at java.lang.Thread.run(Thread.java:864)
  03-19 00:09:48.655: ERROR/ExternalAccountType(31657): Unsupported attribute readOnly
  03-19 00:09:48.900: ERROR/ExternalAccountType(31657): Unsupported attribute readOnly
  03-19 00:09:51.965: ERROR/EmbeddedLogger(434): App crashed! Process: com.example.mapTest
  03-19 00:09:51.965: ERROR/EmbeddedLogger(434): App crashed! Package: com.example.mapTest v1 (1.0)
  03-19 00:09:51.965: ERROR/EmbeddedLogger(434): Application Label: mapTest
  03-19 00:09:51.965: ERROR/AndroidRuntime(22403): FATAL EXCEPTION: main
          java.lang.NoClassDefFoundError: com.google.android.gms.R$styleable
          at com.google.android.gms.maps.GoogleMapOptions.createFromAttributes(Unknown Source)
          at com.google.android.gms.maps.SupportMapFragment.onInflate(Unknown Source)
          at android.support.v4.app.FragmentActivity.onCreateView(FragmentActivity.java:279)
          at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:676)
          at android.view.LayoutInflater.rInflate(LayoutInflater.java:746)
          at android.view.LayoutInflater.inflate(LayoutInflater.java:489)
          at android.view.LayoutInflater.inflate(LayoutInflater.java:396)
          at android.view.LayoutInflater.inflate(LayoutInflater.java:352)
          at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:365)
          at android.app.Activity.setContentView(Activity.java:1912)
          at com.example.mapTest.MainActivity.onCreate(MainActivity.java:13)
          at android.app.Activity.performCreate(Activity.java:5066)
          at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1101)
          at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2307)
          at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2387)
          at android.app.ActivityThread.access$600(ActivityThread.java:151)
          at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1331)
          at android.os.Handler.dispatchMessage(Handler.java:99)
          at android.os.Looper.loop(Looper.java:155)
          at android.app.ActivityThread.main(ActivityThread.java:5485)
          at java.lang.reflect.Method.invokeNative(Native Method)
          at java.lang.reflect.Method.invoke(Method.java:511)
          at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1028)
          at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:795)
          at dalvik.system.NativeStart.main(Native Method)
  03-19 00:09:53.785: ERROR/MediaScannerService(13421): Exception scanning file
          android.os.DeadObjectException
          at android.os.BinderProxy.transact(Native Method)
          at android.media.IMediaScannerListener$Stub$Proxy.scanCompleted(IMediaScannerListener.java:100)
          at com.android.providers.media.MediaScannerService$ServiceHandler.handleMessage(MediaScannerService.java:1007)
          at android.os.Handler.dispatchMessage(Handler.java:99)
          at android.os.Looper.loop(Looper.java:155)
          at com.android.providers.media.MediaScannerService.run(MediaScannerService.java:713)
          at java.lang.Thread.run(Thread.java:864)
  03-19 00:09:54.365: ERROR/NotificationService(434): Ignoring notification with icon==0: Notification(pri=0 contentView=null vibrate=null sound=nullnull defaults=0x0 flags=0x62 kind=[null])
  03-19 00:10:03.075: ERROR/ExternalAccountType(31657): Unsupported attribute readOnly
  03-19 00:10:03.380: ERROR/NotificationService(434): Ignoring notification with icon==0: Notification(pri=0 contentView=null vibrate=null sound=nullnull defaults=0x0 flags=0x62 kind=[null])
  03-19 00:10:03.960: ERROR/ExternalAccountType(31657): Unsupported attribute readOnly
  03-19 00:10:08.200: ERROR/MediaScannerService(13421): Exception scanning file
          android.os.DeadObjectException
          at android.os.BinderProxy.transact(Native Method)
          at android.media.IMediaScannerListener$Stub$Proxy.scanCompleted(IMediaScannerListener.java:100)
          at com.android.providers.media.MediaScannerService$ServiceHandler.handleMessage(MediaScannerService.java:1007)
          at android.os.Handler.dispatchMessage(Handler.java:99)
          at android.os.Looper.loop(Looper.java:155)
          at com.android.providers.media.MediaScannerService.run(MediaScannerService.java:713)
          at java.lang.Thread.run(Thread.java:864)
  03-19 00:10:10.270: ERROR/AndroidRuntime(23231): FATAL EXCEPTION: main
          java.lang.NoClassDefFoundError: com.google.android.gms.R$styleable
          at com.google.android.gms.maps.GoogleMapOptions.createFromAttributes(Unknown Source)
          at com.google.android.gms.maps.SupportMapFragment.onInflate(Unknown Source)
          at android.support.v4.app.FragmentActivity.onCreateView(FragmentActivity.java:279)
          at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:676)
          at android.view.LayoutInflater.rInflate(LayoutInflater.java:746)
          at android.view.LayoutInflater.inflate(LayoutInflater.java:489)
          at android.view.LayoutInflater.inflate(LayoutInflater.java:396)
          at android.view.LayoutInflater.inflate(LayoutInflater.java:352)
          at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:365)
          at android.app.Activity.setContentView(Activity.java:1912)
          at com.example.mapTest.MainActivity.onCreate(MainActivity.java:13)
          at android.app.Activity.performCreate(Activity.java:5066)
          at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1101)
          at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2307)
          at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2387)
          at android.app.ActivityThread.access$600(ActivityThread.java:151)
          at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1331)
          at android.os.Handler.dispatchMessage(Handler.java:99)
          at android.os.Looper.loop(Looper.java:155)
          at android.app.ActivityThread.main(ActivityThread.java:5485)
          at java.lang.reflect.Method.invokeNative(Native Method)
          at java.lang.reflect.Method.invoke(Method.java:511)
          at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1028)
          at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:795)
          at dalvik.system.NativeStart.main(Native Method)
  03-19 00:10:10.285: ERROR/EmbeddedLogger(434): App crashed! Process: com.example.mapTest
  03-19 00:10:10.285: ERROR/EmbeddedLogger(434): App crashed! Package: com.example.mapTest v1 (1.0)
  03-19 00:10:10.285: ERROR/EmbeddedLogger(434): Application Label: mapTest
  </pre>