Monday, 28 February 2011

Tip: Installed Application Not Installed Error

Have you ever loaded up an application, ready to debug, but then seen a message along the lines of, "Application Not Installed" display? This usually has an accompanying LogCat error:

ActivityManager: java.lang.SecurityException: Permission Denial: starting Intent
The cause and solution are very simple:
  • This error is most likely caused by a duplicate Activity class entry in the manifest file. 
    android:name=".MainActivity"  
android:label="@string/app_name">

android:name="android.intent.action.MAIN" />
android:name="android.intent.category.LAUNCHER" />



android:name="MainActivity">
The solution should be clear by now:
  • Remove the duplicate tag from the AndroidManifest.xml file 
  • Build the application again
  • Reload the application
This is quite the opposite of forgetting to add an Activity class to the manifest file. And, yet, it leads to a failure just the same. Proper maintenance of the manifest file is important. It's not a file to mess around with.

Happy Android Coding!

0 comments:

Post a Comment

Twitter Delicious Facebook Digg Stumbleupon Favorites More

 
Powered by Blogger