AS安装apk报错
Performing Streamed Install
adb: failed to install ./app/build/outputs/apk/debug/app-debug.apk: Failure [INSTALL_PARSE_FAILED_MANIFEST_MALFORMED: Failed parse during installPackageLI: /data/app/vmdl808117127.tmp/base.apk (at Binary XML file line #21): com.debug.testtools.MainActivity: Targeting S+ (version 31 and above) requires that an explicit value for android:exported be defined when intent filters are present]
解决
<activity android:name=".MainActivity" android:exported="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
增加android:exported="true"
到activity标签
当前设备Android12,App配置
compileSdkVersion 31
defaultConfig {
applicationId "com.debug.testtools"
minSdkVersion 23
targetSdkVersion 31
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
externalNativeBuild {
cmake {
cppFlags ""
}
}
}