android 应用程序操作:履行意图参数缺少实体集引用

qv7cva1a  于 2023-03-27  发布在  Android
关注(0)|答案(1)|浏览(109)

bounty还有3天到期。回答此问题可获得+300声望奖励。AsafK希望引起更多关注此问题。

我第一次为我的应用程序实现了Google Assistant集成逻辑。该实现在GA内显示了一个小部件,其中包含一些应用程序内数据。当使用Android Studio plugin进行本地测试时,一切正常。
这是我的shortcuts.xml文件:

<shortcuts xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto">

    <capability
        android:name="actions.intent.GET_THING">
        <app-widget
            android:identifier="GET_THING_1"
            android:targetClass="com.myapp.widget.MyWidget">
            <parameter
                android:name="thing.name"
                android:key="shortcutId"
                android:required="true"
                app:shortcutMatchRequired="true" />
            <extra android:name="hasTts" android:value="true"/>
        </app-widget>
    </capability>

</shortcuts>

但是,当提交应用程序到Play商店时,它被拒绝了,并给出了以下响应:
经过审核,由于action.xml文件存在问题,您的应用已被拒绝。如果您提交了更新,则Google Play上仍可以使用您的应用的早期版本。

Action.xml文件中的问题(按APK版本)

履行意图参数thing.name缺少同名参数的实体集引用。
我真的不明白这个评论。它似乎是指不推荐的actions.xml框架,其中使用了<entity-set>元素,但我根本不使用它。
我最好的猜测是,我使用的app:shortcutMatchRequired="true"在我的能力,但我的快捷方式是动态创建的,但这是完全牵强。
这里非常需要帮助。

rfbsl7qr

rfbsl7qr1#

我的猜测是,你得到的错误消息并没有真正反映错误:缺少回退Intent。您可以尝试添加不带参数的回退Intent,例如在此example上看到的。

相关问题