Search code examples
androideclipseadbandroid-4.2-jelly-bean

Android App runs in emulator but says "Not Installed"


I can run my app and do things fine on the emulator in Eclipse. When I go "Home" in the emulator and try to run the App again (by clicking its icon in the Apps folder) it says "App isn't installed"

EDIT: Also I am not being prompted to give permissions on the device itself (emulator or Nexus 7)

Also, when I export the apk to a real device (nexus 7 running 4.2.1) the app does not run and it indicates it is not installed. Any thoughts?

Here is the manifest:

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
  package="com.killerapprejji"
  android:versionCode="1"
  android:versionName="1.0" >

<uses-sdk
    android:minSdkVersion="14"
    android:targetSdkVersion="16" />
<permission android:name="NFC" android:permissionGroup="NFC"></permission>

<application
    android:icon="@drawable/ninjahead"
    android:label="@string/app_name"
    android:theme="@style/AppTheme" android:allowClearUserData="true" android:logo="@drawable/ninjahead" android:persistent="true" android:permission="android.permission.NFC">
    <activity android:name=".MainActivity" android:label="@string/title_activity_main">
        <intent-filter>
          <action android:name="android.nfc.action.NDEF_DISCOVERED"/>
          <data android:mimeType="application/com.killerapprejji.attacked"/>
          <category android:name="android.intent.category.DEFAULT"/>
        </intent-filter>
    </activity>
    <activity android:name=".SplashScreen" android:theme="@android:style/Theme.Black.NoTitleBar.Fullscreen">
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />
            <category android:name="android.intent.category.LAUNCHER"/>  
        </intent-filter>
    </activity>
    <activity android:name=".AttackActivity" android:theme="@style/AppTheme" android:label="@string/attack_button"></activity>
    <activity android:launchMode="standard" android:screenOrientation="portrait" android:label="@string/menu_settings" android:alwaysRetainTaskState="true" android:noHistory="false" android:description="@string/menu_settings" android:configChanges="keyboard" android:theme="@style/AppTheme" android:parentActivityName="@string/title_activity_main" android:icon="@drawable/ninjahead" android:name=".SetInfo"></activity>
    <activity android:name=".DefendActivity" android:label="@string/defend_button" android:theme="@style/AppTheme"></activity>
    <activity android:name="DisplayInteractions" android:theme="@style/AppTheme" android:label="@string/Stats" android:parentActivityName="@string/title_activity_main"></activity>
</application>

</manifest>

Solution

  • There were two problems:

    1) I need

    <uses-permission ... /> 
    

    instead of

    <permission ... />
    

    2)

    <application ... android:permission="android.permission.NFC">
    

    does not need to contain the second part.