Unity 打包Apk后无法运行,报错: Launcher does not have the permission to launch Intent.

Androidstudio 报错日志:Launcher does not have the permission to launch Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=com.x.x.x/com.x.x.x.MainActivity bnds=[838,1266][1006,1434] (has extras) }. Make sure to create a MAIN intent-filter for the corresponding activity or use the exported attribute for this activity.

问题:两台安卓测试机,安装APK后,一个可以运行,一个不能运行

根据建议:

1.Make sure to create a MAIN intent-filter for the corresponding activity
2.Use the exported attribute for this activity(我这次无法运行的原因,所以解释第2点)

<activity android:name=".MainActivity" android:exported="true">// 重点是 android:exported 这个特性要为true 就可以运行了

Android 的安全策略要求应用程序在默认情况下将 android:exported 属性设置为 false,这样可以确保应用程序组件仅供应用程序内部使用,并且不会被其他应用程序访问或启动。但是,某些手机制造商可能对 Android 系统进行了修改,并对权限和安全策略进行了调整。这可能导致在某些手机上需要将 android:exported 属性设置为 true 才能让应用程序正常工作。

注意:报错信息一定要看全… 一般都会给出解决建议

  • 9
    点赞
  • 8
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值