Permission Denial: starting Intent 解决办法

最近在调试程序的时候经常出现ActivityManager: java.lang.SecurityException: Permission Denial: starting Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10000000 cmp=com.xxxxx.xxxxx/.ui.xxxxxxx } from null (pid=-1, uid=-1) requires null的问题,困扰我好几天了,一开始只是认为权限的问题,跟了好久一直没有解决。

后来看到:

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.

才发现这个Activity在Manifest文件里写了两份,去掉一份后,终于可以正常运行了。

注:此问题还会引起,在手机端点击程序图标时,会提示程序未安装在手机上。


原文地址:https://www.cnblogs.com/zziss/p/2538109.html