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,例如:

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

targetSdkVersion的数值

Manifest merger failed : Apps targeting Android 12 and higher are required to specify an explicit_第1张图片

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

Manifest merger failed : Apps targeting Android 12 and higher are required to specify an explicit_第2张图片

如果觉得每次新建项目都修改比较麻烦,可以看这篇文章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

你可能感兴趣的:(Android,android,android-studio)