android - [App Actions Test Tool] 为什么不支持快捷方式xml文件?
问题描述
我使用 Android Shortcuts 框架创建了应用操作: https ://developers.google.com/assistant/app/get-started
快捷方式.xml
<?xml version="1.0" encoding="utf-8"?>
<shortcuts xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
>
<capability android:name="custom.actions.intent.PLUS_DAYS"
queryPatterns="@array/PlusQueries">
<intent
android:action="android.intent.action.VIEW"
android:targetPackage="com.noen.maihue.datetimeplus"
android:targetClass="com.noen.maihue.datetimeplus.MainActivity">
<parameter
android:name="day_number"
android:key="day_number"/>
</intent>
</capability>
<shortcut
android:shortcutId="Plus_Days"
android:shortcutShortLabel="@string/PlusDayShort">
<capability-binding android:key="custom.actions.intent.PLUS_DAYS">
<parameter-binding
android:key="day_number"
android:value="@string/day_number"/>
</capability-binding>
</shortcut>
<!-- Specify more shortcuts here. -->
</shortcuts>
Androidmanifest.xml
<activity android:name=".MainActivity">
<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>
但是如果我创建一个预览来测试,它会发生错误:
App Actions Test Tool v3.5.5
No Android Module with actions file reference found. You need one Android Module with an actions file reference.
Create Actions.xml
为什么应用操作测试工具不支持快捷方式 xml 文件?
解决方案
您需要安装另一个 Android Studio 插件“Google Assistant”,该插件还包含一个“应用操作测试工具”
推荐阅读
- python - 模块 'tensorflow' 没有属性 'get_default_graph' - 我不想要任何图表
- javascript - React - 导出上下文提供程序给我错误:“元素类型无效:预期字符串 [...] 但得到:未定义”
- reactjs - 如何比较 2 个 fetch 数组以在 reactjs 中设置状态
- python - Django从查询集中的外键获取外键
- unity3d - 自动拖动变量
- wordpress - 如何显示 Wordpress 类别页面的自定义分类法?
- c# - 使用 IndexMany 时,Elasticsearch 在动态类型上推断 _id
- java - 如何解决 Kotlin 多平台库项目中的 lambda / SAM 问题?
- google-cloud-data-fusion - 使用 MapReduce 将 SQL Server 数据库映射到 MySQL 数据库时出现空指针异常
- python - 我们可以对 django 包进行更改吗