最近要上架google,要求编译版本最低是30。我想着那就一步到位弄到31吧。
结果报错
/Users/erone/项目/xxx For Google/app/src/main/AndroidManifest.xml Error:
android:exported needs to be explicitly specified for <activity>. 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.
/Users/erone/项目/xxx For Google/app/src/main/AndroidManifest.xml Error:
android:exported needs to be explicitly specified for <activity>. 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.
/Users/erone/项目/xxx For Google/app/src/main/AndroidManifest.xml Error:
android:exported needs to be explicitly specified for <activity>. 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以上manifest里所有activity都要加上android:exported描述。问题是我已经加上了,manifest里的四大组件都有了这个描述
再搜了搜发现是依赖库的问题https://stackoverflow.com/questions/67654506/manifest-merger-failed-targeting-android-12/67668116#67668116
大概意思,检查一下以androidx.test为前缀的依赖是不是最新版本,如果不是升级一下应该就没问题了。我这里包括以下三个
androidx.test:runner
androidx.test.espresso:espresso-core
androidx.test.ext:junit
版本太低,升级下版本就可以了。
要升一起升,要死一起死,难受啊~~
|