将 react 本机应用程序包上传到 Google Play 控制台进行测试,但它向我显示:您上传了带有快捷方式 XML 配置的 APK 或应用程序包,但出现以下错误:元素“<shortcut>”缺少必需的属性“android:shortcutId” . 我的快捷方式.xml 文件:
<?xml version="1.0" encoding="utf-8"?>
<shortcuts xmlns:android="http://schemas.android.com/apk/res/android">
<shortcut android:shortcutId="ID_test" android:enabled="true"
android:shortcutShortLabel="@string/compose_shortcut_short_label"
android:shortcutLongLabel="@string/compose_shortcut_long_label">
<intent android:action="android.intent.action.VIEW"
android:targetPackage="com.nativebasetest2"
android:targetClass="com.nativebasetest2.MainActivity" />
<!-- If your shortcut is associated with multiple intents, include them
here. The last intent in the list determines what the user sees when
they launch this shortcut. -->
<categories android:name="android.shortcut.conversation" />
<capability-binding android:key="actions.intent.OPEN_APP_FEATURE" />
<capability android:name="actions.intent.OPEN_APP_FEATURE">
<intent android:action="android.intent.action.VIEW"
android:targetPackage="com.nativebasetest2"
android:targetClass="com.nativebasetest2.MainActivity">
<extra android:key="requiredForegroundActivity"
android:value="com.nativebasetest2/MainActivity"/>
</intent>
</capability>
</shortcuts>
AndroidManifest.xml 文件:
<activity
android:name=".MainActivity"
android:label="@string/app_name"
android:configChanges=
"keyboard|keyboardHidden|orientation|screenSize|uiMod"
android:launchMode="singleTask"
android:screenOrientation="portrait"
android:windowSoftInputMode="adjustResize">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<meta-data android:name="android.app.shortcuts"
android:resource="@xml/shortcuts" />
</activity>
请帮我找出问题所在,TIA