最详细步骤解决:Apps targeting Android12 and higher are required to specify...

Manifest merger failed : Apps targeting Android 12 and higher are required to specify an explicit v 新建项目运行出现以下异常 Manifest merger failed : Apps targeting Android 12 and higher are required to specify an explicit value for `android:exported` when the corresponding component has an intent filter defined. See https://developer.android.com/guide/topics/mani. 阅读详情
AI摘要

当Android的targetSdkVersion>=31时,需在AndroidManifest.xml中配置android:exported的值。本文介绍了该值的含义及配置要求,给出解决方案,即包含<intent-filter>的四大组件都要添加该属性。还针对添加后仍报错的异常情况,给出排查和解决步骤。

问题原因:

        当targetSdkVersion>=31时,需要在AndroidManifest.xml中配置android:exported的值,该值为boolean类型。

android:exported解释:

        activity 是否可由其他应用的组件启动:

  • 如果设为 "true",那么 activity 可由任何应用访问,并且可通过其确切类名称启动。
  • 如果设为 "false",则 activity 只能由同一应用的组件、使用同一用户 ID 的不同应用或具有特权的系统组件启动。没有 intent 过滤器时,这是默认值。

如果应用中的 activity 包含 intent 过滤器,请将此元素设置为 "true",以允许其他应用启动该 activity。例如,假设 activity 是应用的主要 activity,并且包含 categoryandroid.intent.category.LAUNCHER。

如果此元素设为 "false",并且应用尝试启动该 activity,系统会抛出 ActivityNotFoundException。

此属性并非是限制 activity 向其他应用公开的唯一方式。权限还可用于限制可调用 activity 的外部实体。请参考 permission 属性。

解决方案:

        总结来说就是,AndroidManifest.xml中四大组件中包含了 <intent-filter>的,全部需要加上android:exported,true或者false就根据自己的业务来定。

异常情况:

        这时候就有同学该问了,为什么我明明都加上了,但是还是报这个错呢,我淋过的雨,那必须给你们撑一把伞。

        几种情况
                1、检查自己依赖的 Module中的AndroidManifest.xml是否都加了android:exported
                2、如果第一种情况都加上了并且还是报错
                那么问题就出现在我们依赖的那些库没有加android:exported

        那么我们怎么知道是哪个库没有加,如何给他加上呢?跟着我的步骤一步步来

        一、我们将targetSdkVersion恢复到31以下,然后重新编译一下项目

        二、找到路径为app\build\intermediates\merged_manifests\debug\AndroidManifest.xml

        

        如图所示,将该xml文件打开,直接Ctrl+F搜索<intent-filter>


        三、找一找是哪个没有android:exported然后复制出来,粘贴到你自己项目的AndroidManifest.xml中,添加上android:exported后,重新将targetSdkVersion恢复到31以上编译运行。至此完美落幕,下课!

Android 12 应用兼容性适配指导 Android 12 应用兼容性适配指导 一、兼容性调试工具 Android 11开始引入了新的工具,可针对Android新平台中的行为变更进行测试和调试。这些工具是兼容性框架的一部分,该框架使得开发者可通过开发者选项或adb命令单独打开和关闭各项变更。藉此,可在最新android预览版中测试我们的app受到新平台及target api调整的影响,完成app对新平台的兼容适配。 使用adb命令打开或关闭变更,请运行以下命令之一: adb shell am compat enable (C.. 阅读详情

相关推荐

四自由度机械臂Matlab仿真全流程:从DH参数建模到轨迹规划实战

本文详细介绍了四自由度机械臂在Matlab中的完整仿真流程,从DH参数建模到轨迹规划实战。通过Robotics Toolbox工具,读者可以学习如何构建机械臂模型、验证运动学特性,并实现平滑的轨迹规划。文章还提供了性能优化技巧和常见问题解决方案,帮助开发者高效完成机械臂仿真项目。

weixin_29061041的博客 253

Apps targeting Android 12 and higher are required to specify an explicit value for `android:exported

Manifest merger failed : Apps targeting Android 12 and higher are required to specify an explicit value for `android:exported` when the corresponding component has an intent filter defined.原因:如果应用以 Android 12 或更高版本为目标平台,且包含使用 intent 过滤器的 activity、服务或广播接收器,

WarmPure 1万+

天线学习笔记——串馈网络设计

工程中通常更倾向于使用50Ω、70.7Ω、100Ω的固定阻抗的带宽,实际中可以分别使用固定阻抗的带宽和计算得到的带宽进行仿真,观察二者的性能,取性能更优者即可。本系列是一个记录天线设计的笔记,分享出来也希望能够帮助到大家,后续本系列文章还会不定期更新,如有需要可关注,任何问题均可在评论区或私信提出,看到必回。如果对大家有帮助可进行打赏哦~

Ethan的博客 7903

构建Android12及以上报错:Apps targeting Android12 and higher are required to specify...

如果应用中的 Activity 包含 intent 过滤器,请将此元素设置为“true”,以允许其他应用启动该 Activity。如果应用以 >=Android 12 或更高版本为目标平台,且包含使用 intent 过滤器的 activity、服务或广播接收器,您必须为这些应用组件显式声明 android:exported 属性。如果设为“false”,则 Activity 只能由同一应用的组件、使用同一用户 ID 的不同应用或具有特权的系统组件启动。没有 intent 过滤器时,这是默认值。

u010231454的专栏 5474

DPABI安装教程

DPABI是是中科院心理研究所严超赣老师团队开发的一款磁共振脑影像数据分析工具包。基于SPM,在安装DPABI之前需要安装好SPM,才能正常使用。SPM的安装方法见文matlab2021a版本条件下安装spm_kidllll的博客-CSDN博客 1、下载安装包 下载地址:DPABI: a toolbox for Data Processing & Analysis for Brain Imaging | The R-fMRI Network 2、将下载好的dpabi文件夹移动到matl..

qq_42356925的博客 1万+

边缘设备选型指南:从数据采集到AI推理,工业物联网硬件如何匹配你的需求?

本文提供了一份全面的工业物联网边缘设备选型指南,系统性地阐述了如何根据数据采集、协议兼容性、边缘AI推理算力及环境适应性等核心需求匹配硬件。文章深入剖析了从CPU/GPU/NPU选择到MQTT、Sparkplug B等工业协议支持的实战考量,并强调了软件生态与全生命周期成本的重要性,旨在帮助项目负责人在复杂场景中做出明智决策。

weixin_29168813的博客 94

Apps targeting Android 12 and higher are required to specify an explicit value

Manifest merger failed : Apps targeting Android 12 and higher are required to specify an explicit value for android:exported when the corresponding component has an intent filter defined. See https://developer.android.com/guide/topics/manifest/activity-ele

guangdeshishe的博客 8892

3D Gaussian Splatting的使用

Gaussian splatting 快速生成自己屋子的模型

gootyking的博客 1万+

Manifest merger failed : Apps targeting Android 12 and higher are required to specify an explicit va

意思是说Android12版本以上需要设置android:exported属性。

xiayiye5的博客 3794

高频网络协议与编程IO相关面试基本问题和知识点整理:34道高频题的答案、原理、本机实测与版本差异解析整理(大厂实战记录高频汇总)

本文整理34道网络协议与编程IO高频面试题:22道经典题保留题目、逐题给出准确答案,另补12道近年常问的新题。内容覆盖三次握手与第三个ACK丢失、四次挥手与TIME_WAIT、CLOSE_WAIT、HTTP方法与状态码、五种重定向、HTTPS与TLS 1.3握手、断点续传、长连接与负载均衡、Cookie与Session集群、epoll、BIO与NIO线程数和零拷贝。答案经macOS本机用Python、OpenSSL、curl、浏览器和JDK 17逐项实测,并注明了操作系统与协议版本间的差异。

曾经“等你生日那天”都遥远得像未来,如今却可欢愉的挥手说“下个十年见” 173万+

基于Simulink的锂电池热模型与温控管理仿真

本文完成了基于Simulink的锂电池热模型与温控管理仿真,实现了:✅ 建立电-热耦合产热模型✅ 构建集总参数热网络✅ 设计基于迟滞的风扇启停控制✅ 验证在高倍率工况下的有效温控能力✅ 为实际电池热管理系统(BTMS)提供设计原型。

xiaoheshang_123的博客 153

Manifest merger failed : Apps targeting Android 12 and higher are required to specify an explicit

Android Studio启动app时报错: Manifest merger failed : Apps targeting Android 12 and higher are required to specify an explicit value for `android:exported` when the corresponding component has an intent filter defined. See https://developer.android.com/guide/

北海 4万+

YOLOv11改进策略【Neck】| 适用关键点检测:PSFM,深层语义融合模块 引入深层与浅层交叉注意力机制,动态建模不同层级的全局语义依赖关系

本文记录的是利用PSFM 模块改进 YOLOv11 的颈部融合部分,专门用于关键点检测。PSFM模块(Profound Semantic Fusion Module,深层语义融合模块) 通过在特征提取网络的深层引入跨模态交叉注意力机制,动态建模红外与可见光特征的全局语义依赖关系。本文将其应用到的颈部部分,融合深层与浅层特征,捕捉长距离语义关联,增强融合特征的判别性与场景理解能力,为检测头提供包含全局上下文的高层语义表示,从而提升模型在复杂场景下的目标检测准确率与语义推理鲁棒性。Rethinking the

Limiiiing的博客 657

Manifest merger failed : Apps targeting Android 12 and higher are required to specify an 解决办法

Android studio启动app报错 Manifest merger failed : Apps targeting Android 12 and higher are required to specify an explicit value for `android:exported` when the corresponding component has an intent filter defined. See https://developer.android.com/guide/to

北海 1万+

Probability and Statistics - 4th edition

Probability and Statistics - 4th edition

温度PID控制PLC程序

温度PID稳定控制程序,适用于欧姆龙PLC,对其他PLC也具有很大参考价值

Apps targeting Android 12 and higher are required to specify an explicit value for android:exported

Manifest merger failed : Apps targeting Android 12 and higher are required to specify an explicit value for `android:exported` when the corresponding component has an intent filter defined.

尛码渣的专栏 2450

RU DOS版、EFI版32bit/64bit BIOS常用工具

DOS版、EFI版的RU工具,可用来查看IO、MEM、PCI、SMBIOS等资源。亲测在EFI SHELL下可用。

Android第一行代码-helloworld-及遇到的问题Manifest merger failed : Apps targeting Android 12 and higher are requ

问题:Manifest merger failed : Apps targeting Android 12 and higher are require … 缺少module或者sdk tools,或者不知道如何安装,移动后面 其他问题 Manifest merger failed : Apps targeting Android 12 and higher are required to specify an explicit value for android:exported when the c

karol_peng的博客 4105

TMS_WebGMaps_1.9.8.0_Full_Source

TMS_WebGMaps_1.9.8.0_Full_Source 全源码 delphi cbuilder

Manifest merger failed : Apps targeting Android 12 and higher are required to specify an explicit ..

在跑项目的时候几次遇到这个错误,简单记录以下。 Manifest merger failed : Apps targeting Android 12 and higher are required to specify an explicit value for `android:exported` when the corresponding component has an intent filter defined 解决:根据提示在AndroidManifest.xml文件中给activity添加a

weixin_56691212的博客 3728

Anroid Apps targeting Android 12 and higher are required to specify an explicit value

Manifest merger failed : Apps targeting Android 12 and higher are required to specify an explicit

h5630的博客 2447
上一篇: Android 调音器开发
下一篇: HarmonyOS 鸿蒙开发 路由跳转报错this uri is empty, not support in route push.
android_frost
博客等级 码龄10年 209粉丝 28原创
评论 5
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

android_frost

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值