App Actions提交Play Store被拒:thing.name参数缺失实体集引用求助
解决Google Assistant集成Play商店拒绝问题(thing.name缺少实体集引用)
问题分析
你使用shortcuts.xml实现Google Assistant小部件集成,本地测试正常,但Play商店审核时被拒绝,提示thing.name参数缺少实体集引用。尽管未使用已弃用的action.xml框架,但审核系统对actions.intent.GET_THING内置intent的参数校验仍要求关联实体集——即使你通过快捷方式匹配实现功能,也需要满足这一规则。
解决方案
1. 清理遗留的action.xml文件
检查APK包内是否存在旧的action.xml文件(可能是开发过程中残留的),若有直接删除,避免审核系统混淆新旧框架配置。
2. 在shortcuts.xml中添加实体集关联
修改shortcuts.xml,为thing.name参数关联实体集,并在capability内声明该实体集:
<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"> <!-- 声明实体集 --> <entity-set android:name="AppThingEntitySet" android:entityType="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" app:entitySet="AppThingEntitySet" /> <!-- 关联实体集 --> <extra android:name="hasTts" android:value="true"/> </app-widget> <intent android:identifier="GET_THING_FALLBACK" android:action="android.intent.action.VIEW" android:data="com.myapp.widget.MyWidget" /> </capability> </shortcuts>
3. 确保动态快捷方式与实体匹配
如果快捷方式是动态创建的,需保证每个快捷方式的ID或标签与用户可能说出的thing.name值对应,并且通过ShortcutManager正确注册:
ShortcutManager shortcutManager = getSystemService(ShortcutManager.class); ShortcutInfo shortcut = new ShortcutInfo.Builder(this, "thing_001") .setShortLabel("我的物品1") // 该标签需与用户可能说出的thing.name匹配 .setLongLabel("我的第一个物品") .setIntent(new Intent(this, MyWidget.class)) .build(); shortcutManager.setDynamicShortcuts(Collections.singletonList(shortcut));
4. 验证配置一致性
重新打包APK后,用Android Studio的Google Assistant测试工具验证配置,确保实体集关联和快捷方式匹配逻辑正常,避免本地测试与生产环境的配置差异。
内容的提问来源于stack exchange,提问作者AsafK
相关产品推荐
相关产品推荐

