05/23 16:24:51: Launching 'app' on realme.
Installation did not succeed.
The application could not be installed: INSTALL_PARSE_FAILED_MANIFEST_MALFORMED
List of apks:
[0] 'E:\New folder\MyPlayer\android\app\build\outputs\apk\debug\app-debug.apk'
Installation failed due to: 'Failed to commit install session 1629738225 with command package install-commit 1629738225. Error: INSTALL_PARSE_FAILED_MANIFEST_MALFORMED: Failed parse during installPackageLI: /data/app/vmdl1629738225.tmp/base.apk (at Binary XML file line #75): androidx.media.session.MediaButtonReceiver: Targeting S+ (version 31 and above) requires that an explicit value for android:exported be defined when intent filters are present'
Retry
Failed to launch an application on all devices
我正在开发React Native应用程序,当我尝试通过Android studio运行应用程序时遇到这个问题,并且也尝试了仍然面临这个问题的所有方法INSTALL_PARSE_FAILED_MANIFEST_MALFORMED
这是我的 AndroidManifest.xml
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.myplayer">
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="com.android.vending.BILLING" />
<application
android:name=".MainApplication"
android:label="@string/app_name"
android:icon="@mipmap/ic_launcher"
android:roundIcon="@mipmap/ic_launcher_round"
android:allowBackup="false"
android:theme="@style/AppTheme">
<activity
android:name=".MainActivity"
android:label="@string/app_name"
android:configChanges="keyboard|keyboardHidden|orientation|screenSize|uiMode"
android:launchMode="singleTask"
android:windowSoftInputMode="adjustResize"
android:exported="true"
>
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name="com.facebook.react.devsupport.DevSettingsActivity" />
</application>
</manifest>
androidx.media.session.MediaButtonReceiver: Targeting S+ (version 31 and above) requires that an explicit value for android:exported be defined when intent filters are present
此行被错误提及,因此,您需要更新正在使用
androidx.media.session.MediaButtonReceiver
的库,或者您可以在 AndroidManifest.xml
文件中的 <application>
标签下添加此行作为目标 S+
需要提及 android:exported
对于每项活动、接收者和服务
<receiver android:name="androidx.media.session.MediaButtonReceiver" android:exported="true">
<intent-filter>
<action android:name="android.intent.action.MEDIA_BUTTON" />
</intent-filter>
</receiver>
-124:installPackageLI 期间解析失败:针对 R+(版本 30 及更高版本)要求已安装 APK 的 resources.arsc 未压缩存储并在 4 字节边界上对齐