title: Android phone does not launch the developed apk
body: <p>I have started working with Android Studio today and created a simple Hello World application.</p>
  <p>I have built it to APK file. Then I have moved this APK file onto my phone.
  I have installed this APK. The icon on the desktop of the phone has appeared, but when I am clicking it, the error appears: <strong>Application not found</strong>.</p>
  <p>Phone: Xiaomi Redmi Note 7, Andriod 10.</p>
  <p>Android Studio project is built for Andriod systems, that start from Android 5 Lollipop.</p>
  <p>I have have tried to resolve the issue and tried different things.
  Considering, that I am not sure, where is the problem (xiaomi system, android os, AndroidManifest file, permissions, etc...) I have tried different approaches:</p>
  <ol>
  <li>In case if the problem with the Xiaomi phone:</li>
  </ol>
  <p>I have tried to disable MIUI optimization, enable USB debugging, and enable installation through USB. That is in Android developers settings.
  That did not help and the phone started glitching.</p>
  <ol start="2">
  <li>In case, if the problem is in a way, in which I have built the APK:</li>
  </ol>
  <p>I have tried building it Build &gt; Build Bundle(s) / APK(s) &gt; Build APK(s).
  When I saw, that my phone says, that the &quot;Application not found&quot;, I have tried doing it through Build &gt; Generate Signed Bundle/APK...
  Then I have tried both, for debugging and for release.
  Nothing has helped.</p>
  <ol start="3">
  <li><p>When I thought, that it can be related to permissions to install apps from different sources, I have tried disabling Google Play Protection Scanning.
  That also did not help.</p>
  </li>
  <li><p>I was looking deeper into the AndroidManifest.xml, maybe the problem is there, but it seems to be ok.
  Here is a peace of code:</p>
  <pre><code> &lt;application
   android:allowBackup=&quot;true&quot;
   android:icon=&quot;@mipmap/ic_launcher&quot;
   android:label=&quot;@string/app_name&quot;
   android:roundIcon=&quot;@mipmap/ic_launcher_round&quot;
   android:supportsRtl=&quot;true&quot;
   android:theme=&quot;@style/Theme.Music&quot;&gt;
   &lt;activity
       android:name=&quot;.MainActivity&quot;
       android:exported=&quot;false&quot;&gt;
       &lt;intent-filter&gt;
           &lt;action android:name=&quot;android.intent.action.MAIN&quot;/&gt;
           &lt;category android:name=&quot;android.intent.category.LAUNCHER&quot;/&gt;
       &lt;/intent-filter&gt;
   &lt;/activity&gt;
   &lt;/application&gt;
  </code></pre>
  </li>
  </ol>
  <p>So I really dont know, what am I to do and how to fix it. Any ideas?
  Thanks.</p>
  <p>Edit:</p>
  <p>I have a slow PC, so Android Emulator in the android studio is not working, thus I cannot say, how that would be with the emulator.</p>
  <p>Also, I looked into the folder Android/data/ on my phone and did not find &quot;com.example.music&quot; package (that should be the package name for my application). But I am not sure, that this package should be necessarily in this folder.</p>
  <p>I have scanned this installed application with APK analyzer and it states, that the package for the app is &quot;com.example.music&quot; and that it exists somewhere on the phone. That means, that the app should basically link it, and it should be somewhere.</p>
  <p>Edit 2:</p>
  <p>So I have tried debugging this thing through logcat, and that what I have recieved:</p>
  <pre><code>    2022-05-05 23:38:52.316 2476-2476/? E/Launcher: Launcher does not have the permission to launch Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=com.example.music/.MainActivity bnds=[76,1104][244,1272] (has extras) }. Make sure to create a MAIN intent-filter for the corresponding activity or use the exported attribute for this activity.
      java.lang.SecurityException: Permission Denial: starting Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=com.example.music/.MainActivity bnds=[76,1104][244,1272] (has extras) } from ProcessRecord{6cc44ac 2476:com.miui.home/u0a35} (pid=2476, uid=10035) not exported from uid 10498
          at android.os.Parcel.createException(Parcel.java:2074)
          at android.os.Parcel.readException(Parcel.java:2042)
          at android.os.Parcel.readException(Parcel.java:1990)
          at android.app.IActivityTaskManager$Stub$Proxy.startActivity(IActivityTaskManager.java:3973)
          at android.app.Instrumentation.execStartActivity(Instrumentation.java:1716)
          at android.app.Activity.startActivityForResult(Activity.java:5258)
          at androidx.activity.ComponentActivity.startActivityForResult(ComponentActivity.java:584)
          at com.miui.home.launcher.Launcher.access$11301(Launcher.java:357)
          at com.miui.home.launcher.Launcher.lambda$startActivityForResult$47(Launcher.java:4602)
          at com.miui.home.launcher.-$$Lambda$Launcher$jL9lylEWGhHCXkZoMaZMAX7ydlQ.run(Unknown Source:8)
          at com.miui.home.launcher.Launcher.safelyStartActivity(Launcher.java:4557)
          at com.miui.home.launcher.Launcher.startActivityForResult(Launcher.java:4594)
          at android.app.Activity.startActivity(Activity.java:5583)
          at com.miui.home.launcher.Launcher.startActivity(Launcher.java:4541)
          at com.miui.home.launcher.Launcher$PerformLaunchAction.run(Launcher.java:4471)
          at com.miui.home.launcher.Launcher$PerformLaunchAction.launch(Launcher.java:4451)
          at com.miui.home.launcher.Launcher.launch(Launcher.java:4422)
          at com.miui.home.launcher.ShortcutInfo.handleClick(ShortcutInfo.java:708)
          at com.miui.home.launcher.Launcher.onClick(Launcher.java:4394)
          at android.view.View.performClick(View.java:7185)
          at android.view.View.performClickInternal(View.java:7162)
          at android.view.View.access$3500(View.java:819)
          at android.view.View$PerformClick.run(View.java:27678)
          at com.miui.home.launcher.ItemIcon.post(ItemIcon.java:442)
          at android.view.View.onTouchEvent(View.java:14899)
          at com.miui.home.launcher.ItemIcon.onTouchEvent(ItemIcon.java:420)
          at android.view.View.dispatchTouchEvent(View.java:13484)
          at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3082)
          at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2767)
          at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3088)
          at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2781)
          at com.miui.home.launcher.CellLayout.dispatchTouchEvent(CellLayout.java:629)
          at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3088)
          at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2781)
          at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3088)
          at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2781)
          at com.miui.home.launcher.Workspace.dispatchTouchEvent(Workspace.java:729)
          at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3088)
          at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2781)
          at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3088)
          at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2781)
          at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3088)
          at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2781)
          at com.miui.home.launcher.DragLayer.dispatchTouchEvent(DragLayer.java:237)
          at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3088)
          at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2781)
          at com.miui.home.launcher.ShortcutMenuLayer.dispatchTouchEvent(ShortcutMenuLayer.java:107)
  2022-05-05 23:38:52.316 2476-2476/? E/Launcher:     at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3088)
          at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2781)
          at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3088)
          at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2781)
          at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3088)
          at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2781)
          at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3088)
          at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2781)
          at com.android.internal.policy.DecorView.superDispatchTouchEvent(DecorView.java:498)
          at com.android.internal.policy.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1853)
          at android.app.Activity.dispatchTouchEvent(Activity.java:4059)
          at com.miui.home.launcher.Launcher.dispatchTouchEvent(Launcher.java:4246)
          at com.android.internal.policy.DecorView.dispatchTouchEvent(DecorView.java:456)
          at android.view.View.dispatchPointerEvent(View.java:13745)
          at android.view.ViewRootImpl$ViewPostImeInputStage.processPointerEvent(ViewRootImpl.java:5635)
          at android.view.ViewRootImpl$ViewPostImeInputStage.onProcess(ViewRootImpl.java:5435)
          at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:4936)
          at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:4989)
          at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:4955)
          at android.view.ViewRootImpl$AsyncInputStage.forward(ViewRootImpl.java:5095)
          at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:4963)
          at android.view.ViewRootImpl$AsyncInputStage.apply(ViewRootImpl.java:5152)
          at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:4936)
          at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:4989)
          at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:4955)
          at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:4963)
          at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:4936)
          at android.view.ViewRootImpl.deliverInputEvent(ViewRootImpl.java:7688)
          at android.view.ViewRootImpl.doProcessInputEvents(ViewRootImpl.java:7657)
          at android.view.ViewRootImpl.enqueueInputEvent(ViewRootImpl.java:7618)
          at android.view.ViewRootImpl$WindowInputEventReceiver.onInputEvent(ViewRootImpl.java:7816)
          at android.view.InputEventReceiver.dispatchInputEvent(InputEventReceiver.java:251)
          at android.os.MessageQueue.nativePollOnce(Native Method)
          at android.os.MessageQueue.next(MessageQueue.java:336)
          at android.os.Looper.loop(Looper.java:181)
          at android.app.ActivityThread.main(ActivityThread.java:7590)
          at java.lang.reflect.Method.invoke(Native Method)
          at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:539)
          at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:950)
       Caused by: android.os.RemoteException: Remote stack trace:
          at com.android.server.wm.ActivityStackSupervisor.checkStartAnyActivityPermission(ActivityStackSupervisor.java:1089)
          at com.android.server.wm.ActivityStarter.startActivity(ActivityStarter.java:789)
          at com.android.server.wm.ActivityStarter.startActivity(ActivityStarter.java:588)
          at com.android.server.wm.ActivityStarter.startActivityMayWait(ActivityStarter.java:1390)
          at com.android.server.wm.ActivityStarter.execute(ActivityStarter.java:519)
  </code></pre>