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-element#exported for details.

从Android12开始(targetSdkVersion>=31),在AndroidManifest.xml中声明的四大组件,如果有"intent-filter",则必须显式的设置【android:exported】属性,否则无法编译通过,这个值一般都要设置为true,不然设置"intent-filter"就没太大意义,设置为false其他应用就无法启用该组件(比如应用程序主入口Activity,设置为false后,桌面程序launcher点击该App图标时就会提示"未安装该应用")

在旧版本中,如果加了"intent-filter"默认exported会自动变成true的

你可能感兴趣的:(笔记)