排查问题
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
在开发与应用有关的 Action 时,您可能会遇到设置或与应用有关的 Action 测试工具方面的问题。本页将介绍一些常见问题以及对应的解决方法。
常规错误
错误:“未找到用于打开网址的应用”(出现在消息框通知中)
检查 actions.xml
中的执行方式 urlTemplate
是否配置正确。如果使用的是 App Links 网址,请确保您可以使用 ACTION_VIEW
和相应网址手动触发您的网址。如果使用的是基于 intent 的网址,请确保您的 activity 已正确配置为开始使用提供的参数。
错误:“应用尚未安装”
如果您收到此错误,可能意味着 AndroidManifest.xml
文件中的 <intent-filter>
没有过滤您在 actions.xml
中指定的深层链接。在提交 bug 之前,请务必先检查此问题。
错误:“An entity set reference containing neither an entity set ID nor a URL filter was found.”(出现在 Android Studio 中)
这种情况是由 <entity-set-reference>
标记的已知 linter 问题引起的。您可以放心忽略此消息。如需解决此问题,您可以向该标记添加 tools:ignore="ValidActionsXml"
属性,为其停用 lint 检查。
以下示例展示了一个已停用 lint 检查的 entity 集引用:
<entity-set-reference entitySetId="example" tools:ignore="ValidActionsXml" />
错误:“位置无效”(上传 APK 时,针对操作架构文档显示)
如果您使用了影响发布版 APK 资源的混淆或优化工具,可能会导致 APK 上传失败。ProGuard 等绕过资源文件的工具不会导致此问题。
如需解决此问题,请尝试为应用的 actions.xml
文件停用该工具(例如,使用许可名单)。
错误:“有效的 APK 或 Android App Bundle 包含 actions.xml 文件。要继续操作,请接受《Actions on Google 服务条款》。”(出现在 Google Play 管理中心内)
在 Play 管理中心内创建应用版本时,您可能会看到此错误。如需接受《Actions on Google 服务条款》,请按以下步骤操作:
- 在 Play 管理中心内选择您的应用。
- 依次点击设置 > 高级设置。
- 点击 Actions on Google 标签页。
- 勾选标有使用 Actions on Google 将我的服务与 App Action 集成的复选框,然后按照说明操作。
这可能意味着登录的用户不具备接受这些条款所需的访问权限级别。请务必让 Play 管理中心相关个人资料的管理员完成首次提交。
在尝试以下任一解决方法之前,请将您安装的与应用有关的 Action 测试工具更新到最新版本。
与应用有关的 Action 测试工具插件找不到我的 actions.xml
文件。
确保您已在 AndroidManifest.xml
文件中添加正确的 <meta-data>
标记。
与应用有关的 Action 预览与当前 actions.xml
文件不符。
预览不会根据 actions.xml
文件的内容自行动态更新。因此,当您手动更改 actions.xml
文件或在 Android Studio 中切换 build 变体后,请保存 actions.xml
文件,然后在测试工具中点击 Update Preview。
与应用有关的 Action 测试工具插件已停止运行或生成错误。
首先,请确保您已将 Android Studio 更新到最新版本。如果您收到的是 403 错误,也可能是因为您在没有运行权限的软件包上运行该插件。
如果错误仍然存在,请提交 bug 并向 Google 发送以下详细信息:
- 错误对话框中显示的详细信息
- Android Studio 日志。只需依次选择 Help > Show Log in Finder,界面中即会显示
idea.log
在您 Finder 中的位置。在该日志文件中,搜索“Submit Actions Request Body:”,并粘贴服务器响应(应有两条操作结果)。
与应用有关的 Action 测试工具生成 UnknownHostException
或其他网络连接错误
与应用有关的 Action 测试工具会创建与应用有关的 Action 的预览,让您能通过单个 Google 账号测试 Google 助理集成。测试工具需要连接到互联网,必要时还需具备对 Google 域名的代理访问权限,才能创建这类预览。
若要解决运行测试工具时出现的网络问题,请检查以下常见问题:
使用测试插件调用与应用有关的 Action 时,Google 助理说“Sorry, I couldn't find that”。
这条响应可能会因各种原因显示,具体取决于您的设置。请尝试采取以下措施:
- 使用同一个 Google 账号登录 Android Studio、Play 管理中心和测试设备。
- 启用设备数据同步。
- 将设备和 Google 助理的语言设为
en-US
。
- 检查 Google Play 管理中心内相关应用的软件包名称是否与测试应用中的软件包名称一致。
- 在
actions.xml
文件的执行方式 urlTemplate
定义中,确保 android:host
和 android:scheme
的值与 AndroidManifest
文件中声明的值一致。
- 从测试设备中移除您的应用所有以前的安装版本,然后安装新的 build。
- 从与应用有关的 Action 测试工具中删除预览,然后重新创建新的预览。
- 在 Logcat 工具中检查与 Google 助理的执行方式相关的失败问题。您应该会看到为您应用启动的 intent。
- 为账号启用“您设备中的应用信息”设置。
- 打开 Google 助理,确保已完成设置。(设置进度条通常会以蓝色指示条的形式显示在屏幕底部,但在某些情况下外观可能会有所不同。)
- 在使用 Google 助理触发与应用有关的 Action 时,确保调用名称和与应用有关的 Action 测试工具创建的预览相符。
- 尝试使用文本输入,而不是语音输入,以避免任何转录错误。
- 配置测试 build,让
applicationId
与上传到 Google Play 管理中心的 APK 或 AAB 完全一致。请注意,可选的 applicationIdSuffix
属性可以为某些产品变种和 build 变体更改 build 的最终 applicationId
。在此示例中,模拟产品变种的 applicationId
为 com.example.android.architecture.blueprints.master.mock
,而不是 com.example.android.architecture.blueprints
。
- 将预览配置为使用唯一调用名称。请尝试使用唯一字词,以降低与其他应用发生冲突的可能性。
- 若要在对可共享代码库进行问题排查时找出问题,请尝试运行与应用有关的 Action 健身应用示例,确保该健身应用可端到端地正常运行,然后逐步在此应用的基础上添加其他功能,看看能否重现问题。
- 如果使用的是 G Suite 账号,请确保 Google 助理是由管理员开启的。如需解决此问题,建议您创建一个非 G Suite 测试账号,并将该账号设置为通过 Play 商店获得许可的测试人员账号。测试人员应该可以通过这个账号为自己的应用创建预览,并在其设备上使用它成功运行测试。
- 如果您将 Google 助理作为单独的应用下载,请尝试在相关设备上强行停止该应用。您通常可以通过手机的“设置”应用强行停止应用。
- 如果上述措施均不起作用,请在与应用有关的 Action 问题跟踪器中报告问题。
本页面上的内容和代码示例受内容许可部分所述许可的限制。Java 和 OpenJDK 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-07-27。
[[["易于理解","easyToUnderstand","thumb-up"],["解决了我的问题","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["没有我需要的信息","missingTheInformationINeed","thumb-down"],["太复杂/步骤太多","tooComplicatedTooManySteps","thumb-down"],["内容需要更新","outOfDate","thumb-down"],["翻译问题","translationIssue","thumb-down"],["示例/代码问题","samplesCodeIssue","thumb-down"],["其他","otherDown","thumb-down"]],["最后更新时间 (UTC):2025-07-27。"],[],[],null,["# Troubleshoot issues\n\nWhen developing App Actions, you might encounter issues with your setup or with\nthe App Actions test tool. This page describes some commonly encountered issues\nand their fixes.\n\nGeneral\n-------\n\n### Error: \"No App found to open URL\" appears in a toast notification\n\nCheck your fulfillment `urlTemplate` in your `actions.xml` to make sure it's\nconfigured correctly. If using App Links URLs, ensure you can trigger your URL\nmanually using `ACTION_VIEW` and the URL. If using intent-based URLs, ensure\nyour Activity is correctly configured to start using the provided parameters.\n\n### Error: \"App isn't installed\"\n\nThis error may mean that the `\u003cintent-filter\u003e` in your `AndroidManifest.xml`\nfile doesn't filter the deep link that you specified in your `actions.xml`.\nMake sure you check this first before filing a bug.\n\n### Error: \"An entity set reference containing neither an entity set ID nor a URL filter was found.\" appears in Android Studio\n\nThis condition is caused by a known linter issue for the\n`\u003centity-set-reference\u003e` tag. You can safely ignore this message. As a\nworkaround, you can disable lint check for this tag by adding the\n`tools:ignore=\"ValidActionsXml\"` attribute to it.\n\nHere's an example of an entity set reference with a disabled lint check: \n\n```gdscript\n\u003centity-set-reference entitySetId=\"example\" tools:ignore=\"ValidActionsXml\" /\u003e\n```\n\n\u003cbr /\u003e\n\n### Error: \"Invalid location\" for actions schema document when uploading APK\n\nYour APK upload may fail if you use an obfuscation or optimization tool that\naffects resources for your release APK. Tools like ProGuard that avoid\nresource files do not cause this issue.\n\nTo resolve this issue, try disabling the tool for your app's `actions.xml`\nfile (for example, by using an allowlist).\n\n### Error: \"An active APK or Android App Bundle contains an actions.xml file. In order to continue, accept the Actions on Google Terms of Service.\" appears in Google Play Console\n\nYou may see this error while creating an app release in the Play Console. To\naccept the Actions on Google Terms of Service, follow these steps:\n\n1. Select your app in the Play Console.\n2. Navigate to **Setup \\\u003e Advanced Settings**.\n3. Click the **Actions on Google** tab.\n4. Check the box labeled **Integrate my services with App Actions using Actions\n on Google**, and follow the instructions.\n\n### The \"Accept\" button on Play Terms of Service form is disabled.\n\nThis might mean that the signed in user doesn't have the required access\nlevel to accept those terms. Make sure the first submission is done by the\nadministrator of the Play Console profile.\n\nApp Actions test tool\n---------------------\n\nBefore attempting any of the following fixes, update your installation of the\nApp Actions test tool to the most recent version.\n\n### The App Actions test tool plugin cannot locate my `actions.xml` file.\n\nEnsure you have added the correct `\u003cmeta-data\u003e` tag in your\n`AndroidManifest.xml` file.\n\n### My App Action preview doesn't match my current `actions.xml` file.\n\nYour preview does not update itself dynamically with the content of your\n`actions.xml` file. After you change your `actions.xml` file manually or after\nswitching build variants in Android Studio, save your `actions.xml` file and\nclick **Update Preview** in the test tool.\n\n### The App Actions test tool plugin stopped working or is generating errors.\n\nFirst, make sure you've updated Android Studio to the latest version. If\nyou are getting a 403 error, you also might be running the plugin on a\npackage where you don't have permissions to run on.\n\nIf the error still persists, please file a bug and send the following\ndetails to Google:\n\n- Details of the error dialog\n- Android Studio Logs. Go to **Help \\\u003e Show Log in Finder** . This shows you the location of the `idea.log` in your Finder. Search for \"Submit Actions Request Body:\" in the log file, and paste the server responses (there should be two results for actions).\n\n### The App Actions test tool generates `UnknownHostException`, or other network errors\n\nThe App Actions test tool creates a preview of your App Actions, enabling you to\ntest Google Assistant integrations with a single Google Account. To create these\npreviews, the test tool requires an active internet connection and, if\nnecessary, proxy access to Google domains.\n\nTo resolve network issues when running the test tool, check for these common\nissues:\n\n- Ensure you have an active internet connection before generating previews.\n- If your internet connection is active, and your local network uses a proxy\n server, check the following:\n\n - Verify your IDE proxy configuration. For more information, see proxy configuration instructions for [Android Studio](https://developer.android.com/studio/intro/studio-config#proxy), or [IntelliJ](https://www.jetbrains.com/help/idea/settings-http-proxy.html).\n - If your proxy requires an access control list (ACL), update the ACL to allow this URL pattern: `https://actions.googleapis.com/**`.\n\n### When invoking the App Action with the test plugin, the Assistant says, \"Sorry, I couldn't find that.\"\n\nDepending on your setup, this response may appear for different reasons. Try\nthe following steps:\n\n1. Sign in to Android Studio, the Play Console, and your test device with the same Google Account.\n2. Enable [device data syncing](//myaccount.google.com/deviceapps).\n3. Set the device and Google Assistant language to `en-US`.\n4. Check that the package name of the application in the Google Play Console matches with the package name in the test application.\n5. In the fulfillment `urlTemplate`definition in your `actions.xml` file, make sure that the `android:host` and `android:scheme` values match what's declared in the `AndroidManifest` file.\n6. Remove all previous installations of your app from your test device and install a fresh build.\n7. Delete the preview from App Actions test tool and create a new preview again.\n8. Check in the Logcat tool for failures related to fulfillment for Google Assistant. You should see an intent launched to your app.\n9. [Enable the 'App info for your devices' setting](https://support.google.com/accounts/answer/9503395?co=GENIE.Platform%3DAndroid) for the account.\n10. Open Google Assistant and ensure you have completed setup. (Usually the setup progress bar appears as a blue bar at the bottom of the screen, but it may look different in some cases.)\n11. When using Google Assistant to trigger an App Action, make sure that the invocation name matches the preview created by the App Actions test tool.\n12. Try using text input instead of voice to avoid any transcription errors.\n13. Configure your test build so that the `applicationId` exactly matches an APK or AAB uploaded to the Google Play Console. Note that optional `applicationIdSuffix` properties can change the final `applicationId` of builds for certain product flavors and build variants. In this [example](https://www.google.com/url?sa=D&q=https%3A%2F%2Fgithub.com%2Fandroid%2Farchitecture-samples%2Fblob%2Fmaster%2Fapp%2Fbuild.gradle%23L53), the `applicationId` for the mock product flavor is `com.example.android.architecture.blueprints.master.mock`, instead of `com.example.android.architecture.blueprints`.\n14. Configure your preview to use a unique invocation name. Try using a unique word that reduces the chances for collision with other apps.\n15. To isolate issues when troubleshooting a shareable codebase, try running the [the sample App Actions Fitness App](https://github.com/actions-on-google/appactions-fitness-kotlin). Make sure that the Fitness app works end-to-end. Then incrementally add additional features on top of this app to see if you can replicate issues.\n16. If using G Suite accounts, make sure Google Assistant is [turned on by the\n administrator](https://support.google.com/a/answer/9620347#:%7E:text=As%20an%20administrator%2C%20you%20control,or%20while%20working%20from%20home). We recommend creating a non-G Suite test account as a workaround and setting it up as a [licensed tester through Play Store](https://developers.google.com/assistant/app/test-tool#additional-testers). From that account, testers should be able to create previews for their app and test using that account on their device successfully.\n17. If you downloaded Google Assistant as a separate app, try force stopping it on your device. You can usually force stop an app through your phone's Settings app.\n18. If none of these steps work, raise a issue in the [App Action issue tracker](https://issuetracker.google.com/issues?q=componentid:617864%20status:open)."]]