Android12安装报错:Targeting S+ (version 31 and above) requires that an explicit value for android:export

季小云
2023-12-01

1.报错:

adb: failed to install out/target/product/blueline/testcases/AudioDemo/arm64/AudioDemo.apk: Failure [INSTALL_PARSE_FAILED_MANIFEST_MALFORMED: Failed parse during installPackageLI: /data/app/vmdl1547233782.tmp/base.apk (at Binary XML file line #21): com.test.audiodemo.MainActivity: Targeting S+ (version 31 and above) requires that an explicit value for android:exported be defined when intent filters are present]

2.解决

1.在AndroidManifest.xml增加android:exported="true"
# emacs AndroidManifest.xml
<activity android:name=".MainActivity"
+	      android:exported="true"
	      >

 类似资料: