Java.lang.SecurityException: permission denial: start Intent {act = android.intent.action.MAIN cat = [android.intent.category.LAUNCHER]

Error starting activity , unfortunately, I assume that it is not strictly related to the project due to the fact that the application runs on the genymotion emulator, but not on the physical device.

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

 List of devices attached 0009215b1eef4f device 

AndroidManifest.xml does not have any necessary permissions, and the device has enough api version .

Hello

+6
source share
2 answers

The problem was choosing Launcher in Android Studio. To increase the speed of testing the application module, another activity was selected as Launcher (in the launch properties) than indicated in manifest.xml. It is strange that he even worked on an emulator.

The solution is to simply replace Launcher with one set of AndroidManifest.xml

+8
source

Just add:

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

on AndroidManifest.xml in tag:

 <activity> 

Hope this helps

+9
source

Source: https://habr.com/ru/post/977043/


All Articles