最近手欠升级了Android Sdk到33时,打包安卓产生以下问题。
AndroidManifest.xml Error:
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.
See http://g.co/androidstudio/manifest-merger for more information about the manifest merger.
Execution failed for task ‘:launcher:processDebugMainManifest’.
> Manifest merger failed with multiple errors, see logs
一。尝试按说明添加了android:exported,问题依旧。所以采用了第2种解决方案,降sdk版本。
二。降安卓sdk版本
1.设置安卓工程的Sdk版本如下图:
2.设置完成之后,把工程中所有build.gradle配置文件里的相关sdk都修改成和上图配置的版本号一致即可。
compileSdkVersion 30 buildToolsVersion '30.0.2' targetSdkVersion 30