title: Android app using google maps not working on phone
body: <p>I'm developing an application which uses a map. I use my galaxy nexus to test the app but after I included the code related to the map it stopped working on my phone but it still works on the emulator. The problem is that the emulator doesnt show the map because it doesnt have Google Play Services. </p>
  
  <p>When I try to launch the app I get no error but my phone does nothing, and if I try to run it manually from the app drawer the app is there but it says "isn't installed". </p>
  
  <p>Here is the java code MainActivity.java</p>
  
  <pre><code>package myPackage.android;
  
  import com.actionbarsherlock.app.SherlockFragmentActivity;
  import android.content.Intent;
  import android.os.Bundle;
  import android.support.v4.app.NavUtils;
  import com.actionbarsherlock.view.*;
  
  public class MainActivity extends SherlockFragmentActivity {
  
  @Override
  protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.activity_main);
  
      //private GoogleMap map;
  
  }
  
  @Override
  public boolean onCreateOptionsMenu(Menu menu) {
      // Inflate the menu; this adds items to the action bar if it is present.
      getSupportMenuInflater().inflate(R.menu.main, menu);
      return true;
  }
  
  public boolean onOptionsItemSelected(MenuItem item) {
      switch (item.getItemId()) {
      case android.R.id.home:
          NavUtils.navigateUpFromSameTask(this);
          return true;
  
      case R.id.action_search:
          final int RESULT=1;
          startActivityForResult(new Intent(MainActivity.this, SearchForm.class), RESULT);
          return true;
      }
      return super.onOptionsItemSelected(item);
  }
  
  }
  </code></pre>
  
  <p>Here's the xml layout activity_main.xml</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
    &lt;fragment xmlns:android="http://schemas.android.com/apk/res/android"
     android:id="@+id/map"
     android:layout_width="fill_parent"
     android:layout_height="fill_parent"
     class="com.google.android.gms.maps.SupportMapFragment" /&gt;
  </code></pre>
  
  <p>and the manifest:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;manifest xmlns:android="http://schemas.android.com/apk/res/android"
  package=myPackage.android"
  android:versionCode="1"
  android:versionName="1.0" &gt;
  
  &lt;uses-feature
      android:glEsVersion="0x00020000"
      android:required="true"/&gt;
  
  &lt;uses-sdk
      android:minSdkVersion="8"
      android:targetSdkVersion="17" /&gt;
  
  &lt;uses-permission android:name="android.permission.INTERNET"/&gt;
  &lt;uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/&gt;
  &lt;uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/&gt;
  &lt;uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES"/&gt;
  &lt;uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/&gt;
  &lt;uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/&gt;
  
  &lt;permission
      android:name="myPackage.android.permission.MAPS_RECEIVE"
      android:protectionLevel="signature"/&gt;
  &lt;uses-permission android:name="myPackage.android.permission.MAPS_RECEIVE"/&gt;
  
  &lt;application
      android:allowBackup="true"
      android:icon="@drawable/ic_launcher"
      android:label="@string/app_name"
      android:theme="@style/Theme.Sherlock.Light.DarkActionBar" &gt;
  
      &lt;meta-data
  android:name="com.google.android.maps.v2.API_KEY"
  android:value="my ap map key"/&gt;
  
  
      &lt;activity
          android:name="myPackage.android.SplashScreen"
          android:label="@string/app_name"
          android:noHistory="true"
          android:screenOrientation="portrait"
          android:theme="@android:style/Theme.Black.NoTitleBar"
          android:permission="android.permission.INTERNET" &gt;
          &lt;intent-filter&gt;
              &lt;action android:name="android.intent.action.MAIN" /&gt;
              &lt;category android:name="android.intent.category.LAUNCHER" /&gt;
          &lt;/intent-filter&gt;
      &lt;/activity&gt;
  
      &lt;activity
          android:name="myPackage.android.MainActivity"
          android:label=""
          android:logo="@drawable/logo"
          android:screenOrientation="portrait" 
          android:permission="android.permission.INTERNET" &gt;
      &lt;/activity&gt;
  
      &lt;activity
          android:name="myPackage.android.SearchForm"
          android:label="@string/title_activity_search_form"
          android:parentActivityName="ar.com.package.android.MainActivity" &gt;
          &lt;meta-data
              android:name="android.support.PARENT_ACTIVITY"
              android:value="myPackage.android.MainActivity" /&gt;
      &lt;/activity&gt;
  
  &lt;/application&gt;
  
  &lt;/manifest&gt;
  </code></pre>
  
  <p>logCat</p>
  
  <pre><code>05-09 21:17:04.744: D/AndroidRuntime(15507): &gt;&gt;&gt;&gt;&gt;&gt; AndroidRuntime START com.android.internal.os.RuntimeInit &lt;&lt;&lt;&lt;&lt;&lt;
  05-09 21:17:04.744: D/AndroidRuntime(15507): CheckJNI is OFF
  05-09 21:17:04.752: D/dalvikvm(15507): Trying to load lib libjavacore.so 0x0
  05-09 21:17:04.760: D/dalvikvm(15507): Added shared lib libjavacore.so 0x0
  05-09 21:17:04.768: D/dalvikvm(15507): Trying to load lib libnativehelper.so 0x0
  05-09 21:17:04.768: D/dalvikvm(15507): Added shared lib libnativehelper.so 0x0
  05-09 21:17:04.908: D/AndroidRuntime(15507): Calling main entry com.android.commands.pm.Pm
  05-09 21:17:04.916: D/AndroidRuntime(15507): Shutting down VM
  05-09 21:17:04.916: D/dalvikvm(15507): GC_CONCURRENT freed 97K, 18% free 482K/584K, paused 1ms+0ms, total 4ms
  05-09 21:17:04.924: D/jdwp(15507): Got wake-up signal, bailing out of select
  05-09 21:17:04.924: D/dalvikvm(15507): Debugger has detached; object registry had 1 entries
  05-09 21:17:05.314: D/AndroidRuntime(15519): &gt;&gt;&gt;&gt;&gt;&gt; AndroidRuntime START com.android.internal.os.RuntimeInit &lt;&lt;&lt;&lt;&lt;&lt;
  05-09 21:17:05.314: D/AndroidRuntime(15519): CheckJNI is OFF
  05-09 21:17:05.330: D/dalvikvm(15519): Trying to load lib libjavacore.so 0x0
  05-09 21:17:05.330: D/dalvikvm(15519): Added shared lib libjavacore.so 0x0
  05-09 21:17:05.338: D/dalvikvm(15519): Trying to load lib libnativehelper.so 0x0
  05-09 21:17:05.338: D/dalvikvm(15519): Added shared lib libnativehelper.so 0x0
  05-09 21:17:05.486: D/AndroidRuntime(15519): Calling main entry com.android.commands.am.Am
  05-09 21:17:05.494: D/dalvikvm(15519): Note: class Landroid/app/ActivityManagerNative; has 157 unimplemented (abstract) methods
  05-09 21:17:05.502: I/ActivityManager(407): START u0 {act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10000000 cmp=myPackage.android/.SplashScreen} from pid 15519
  05-09 21:17:05.502: I/AndroidRuntime(15519): VM exiting with result code 1.
  05-09 21:17:05.502: W/ActivityManager(407): Permission Denial: starting Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10000000 cmp=myPackage.android/.SplashScreen } from null (pid=15519, uid=2000) requires android.permission.INTERNET
  </code></pre>