java.lang.SecurityException: Permission Denial: starting Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER]

12,678

Solution 1

The issue was with Launcher selection in Android Studio. To improve testing speed of application module there was selected other Activity as Launcher(in run properties) than specified in manifest.xml. Strange that it worked even on emulator..

The solution is simply to change the Launcher to the one set in AndroidManifest.xml

Solution 2

Simply add:

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

on AndroidManifest.xml into the tag:

<activity>

Hope it helps

Share:
12,678
Jacob
Author by

Jacob

Hi :) .. avoid this for your life quality ;) https://www.linkedin.com/in/kozlowskijakub

Updated on June 13, 2022

Comments

  • Jacob
    Jacob almost 2 years

    There is an error launching activity, unfortunately I assume it is not connected strictly with the project due to the fact the app launches on genymotion emulator, but does not on physical device.

    When I run adb devices with the real one connected i get:

    List of devices attached 
    0009215b1eef4f  device
    

    AndroidManifest.xml has not any permissions required set and device has sufficient api version.

    Regards