Skip to content Skip to sidebar Skip to footer

Android : Permission Denied Error When Changing Launcher Activity

I have an android app that I am trying to launch and it gives me the error java.lang.SecurityException: Permission Denial: starting Intent { act=android.intent.action.MAIN cat=[an

Solution 1:

As stated by Jomia:

The java.lang.SecurityException you are seeing is because you may enter two entries pointing to same activity. Remove the second one and you should be good to go.

and finally after changing Main activity to MainActivity in manifest Clean your Project from Project->Clean... before running on device

Solution 2:

You should try to mark MainActivity in your AndroidManifest.xml with attribute exported. Like this:

<activityandroid:exported="true"android:name=".MainActivity"android:screenOrientation="portrait"android:label="MainActivity">

Solution 3:

Frequently, requires null in a SecurityException means that the component is not exported. There is a possibility that may not be a your problem. Activity is automatically exported when it has an <intent-filter> tag. I recommend

  • clean the project
  • build
  • full uninstall app from device
  • re-install

Solution 4:

If you are using GIT:Delete the whole repository folder and resync it with your git-server.

Post a Comment for "Android : Permission Denied Error When Changing Launcher Activity"