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/topics/manifest/activity-element#exported for details.

所用环境:Android studio 4.2.2,Pixel 2 API 29

解决办法参考:

在AndroidManifest.xml文件中给activity添加android:exported,例如:

<activity android:name=".MainActivity" android:exported="true">

根据评论区老哥提醒,除此之外还可以修改build.gardle(:app)文件的相关配置,修改

targetSdkVersion的数值

也可以直接进入Project Structure修改相关数据

如果觉得每次新建项目都修改比较麻烦,可以看这篇文章Manifest merger failed : Apps targeting Android 12 and higher are required to specify an 解决办法_北海-CSDN博客icon-default.png?t=LA92https://blog.csdn.net/weixin_42360806/article/details/120542301

本文转自 https://blog.csdn.net/weixin_42360806/article/details/118888920,如有侵权,请联系删除。

posted @ 2022-06-09 16:31  yassine  阅读(1134)  评论(0编辑  收藏  举报