android 15升级适配无法安装运行,并且提示应用未安装

最近升级项目到android15,一开始遇到这个报错,以为是广播的问题,因为当时在Log中发现这个的报错

  • One of RECEIVER_EXPORTED or RECEIVER_NOT_EXPORTED should be

这条报错的解决方案依据 google开发者android14 关于这条的 原文:

  • Apps and services that target Android 14 and use context-registered receivers are required to specify a flag to indicate whether or not the receiver should be exported to all other apps on the device: either RECEIVER_EXPORTED or RECEIVER_NOT_EXPORTED, respectively. This requirement helps protect apps from security vulnerabilities by leveraging the features for these receivers introduced in Android 13.

但是之前升级不在主分支上,那个分支解决后切换主分支后安装run 日志模块中又报这个日志

-Exception occurred while executing 'start':

java.lang.SecurityException: Permission Denial: starting Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10000000 cmp=com.asus.rogforum/com.zhiyicx.thinksnsplus.modules.guide.GuideActivity } from null (pid=15320, uid=2000) not exported from uid 10219

at com.android.server.wm.ActivityTaskSupervisor.checkStartAnyActivityPermission(ActivityTaskSupervisor.java:1270)

at com.android.server.wm.ActivityStarter.executeRequest(ActivityStarter.java:1266)

at com.android.server.wm.ActivityStarter.execute(ActivityStarter.java:901)

at com.android.server.wm.ActivityTaskManagerService.startActivityAsUser(ActivityTaskManagerService.java:1401)

at com.android.server.wm.ActivityTaskManagerService.startActivityAsUser(ActivityTaskManagerService.java:1346)

at com.android.server.am.ActivityManagerService.startActivityAsUserWithFeature(ActivityManagerService.java:3532)

at com.android.server.am.ActivityManagerShellCommand.runStartActivity(ActivityManagerShellCommand.java:800)

at com.android.server.am.ActivityManagerShellCommand.onCommand(ActivityManagerShellCommand.java:246)

at com.android.modules.utils.BasicShellCommandHandler.exec(BasicShellCommandHandler.java:97)

at android.os.ShellCommand.exec(ShellCommand.java:38)

at com.android.server.am.ActivityManagerService.onShellCommand(ActivityManagerService.java:10971)

at android.os.Binder.shellCommand(Binder.java:1230)

at android.os.Binder.onTransact(Binder.java:1043)

at android.app.IActivityManager$Stub.onTransact(IActivityManager.java:5785)

at com.android.server.am.ActivityManagerService.onTransact(ActivityManagerService.java:2962)

at android.os.Binder.execTransactInternal(Binder.java:1505)

at android.os.Binder.execTransact(Binder.java:1444)

然后我找到主界面偶然看到exported 为false,改为true后尝试运行了一下,纳尼,竟然成功安装了,以后还是得仔细看日志啊,里面关键信息 not exported from 是 要敲脑袋得

相关推荐
我最厉害。,。18 分钟前
XSS 跨站&SVG&PDF&Flash&MXSS&UXSS&配合上传&文件添加脚本
android·pdf·xss
阿斌_bingyu70921 分钟前
Arduino开发物联网ESP32快速入门指南(包含开发语言说明、学习路径和实战教程)
开发语言·物联网·学习
Jwoka39 分钟前
正则表达式学习笔记
笔记·python·正则表达式·re
移远通信1 小时前
智能硬件开发革命:低代码平台+物联网
python·物联网·低代码·智能硬件
这个懒人1 小时前
linux下io操作详细解析
开发语言·c++·io
亚林瓜子1 小时前
python的web框架flask(hello,world版)
python·flask·conda·web·python3
东方醴歌1 小时前
VMware安装飞牛私有云fnOS并挂载小雅Alist实现异地远程访问
开发语言·后端·golang
暗影~行星1 小时前
C语言,原码、补码、反码
c语言·开发语言
晨曦5432102 小时前
python——正则表达式
开发语言·正则表达式
极客先躯2 小时前
高级java每日一道面试题-2025年4月01日-微服务篇[Nacos篇]-Nacos集群的数据一致性是如何保证的?
java·开发语言·微服务