疑難排解
透過集合功能整理內容
你可以依據偏好儲存及分類內容。
開發應用程式動作時,可能會遇到設定或應用程式動作測試工具相關的問題。本頁將說明部分常見問題及其修正方法。
適合各年齡層使用者
錯誤:浮動式訊息通知顯示「找不到可以開啟網址的應用程式」
檢查 actions.xml
中的 urlTemplate
執行要求,確認設定正確無誤。如果要使用應用程式連結網址,請確保您可以使用 ACTION_VIEW
和網址手動觸發網址。如果是使用意圖網址,請確保 Activity 的設定正確無誤,可開始使用提供的參數。
錯誤:「應用程式未安裝」
這項錯誤可能表示 AndroidManifest.xml
檔案中的 <intent-filter>
未篩選 actions.xml
中指定的深層連結。回報錯誤前,請務必先檢查這一點。
錯誤:Android Studio 顯示「系統找到未包含實體集 ID 和網址篩選器的實體集參照。」
這個狀況是由 <entity-set-reference>
標記的已知 Linter 問題所造成。您可以放心忽略此訊息。如要解決問題,可以在該標記中加入 tools:ignore="ValidActionsXml"
屬性,停用 Lint 檢查。
以下是 Lint 檢查已停用的實體組合參照範例:
<entity-set-reference entitySetId="example" tools:ignore="ValidActionsXml" />
錯誤:上傳 APK 時,動作架構文件發生「位置無效」錯誤
如果您使用的模糊處理或最佳化工具會影響發布版 APK 的資源,APK 上傳作業可能會失敗。ProGuard 等會避開資源檔案的工具則不會引起這個問題。
如要解決這個問題,請嘗試針對應用程式的 actions.xml
檔案停用該工具 (例如,使用許可清單)。
錯誤:Google Play 管理中心顯示「目前使用的 APK 或 Android App Bundle 含有 actions.xml 檔案。如要繼續,請接受《Actions on Google 服務條款》。」
在 Play 管理中心建立應用程式版本時,系統可能會顯示這個錯誤。如要接受《Actions on Google 服務條款》,請按照下列步驟操作:
- 在 Play 管理中心選取應用程式。
- 依序前往「設定」>「進階設定」。
- 按一下「Actions on Google」分頁標籤。
- 勾選標示為「使用 Actions on Google 將我的服務與 App Actions 進行整合」的方塊,然後按照指示操作。
這可能表示登入的使用者未具備所需存取層級,因此無法接受這些條款。請確認 Play 管理中心設定檔的系統管理員已完成首次提交作業。
嘗試進行下列修正作業之前,請先更新應用程式動作測試工具來安裝最新版本。
應用程式動作測試工具外掛程式找不到 actions.xml
檔案。
請確認您已在 AndroidManifest.xml
檔案中加入正確的 <meta-data>
標記。
應用程式動作預覽與目前的 actions.xml
檔案不相符。
預覽畫面不會自行動態更新為 actions.xml
檔案的內容。手動變更 actions.xml
檔案或在 Android Studio 中切換建構變化版本後,請儲存 actions.xml
檔案,然後按一下測試工具中的「Update Preview」。
應用程式動作測試工具外掛程式已停止運作或產生錯誤。
首先,請確認 Android Studio 已更新至最新版本。如果系統顯示 403 錯誤,表示您也可能在未具備執行權限的套件中執行外掛程式。
如果錯誤仍未解決,請回報錯誤並將下列詳細資料傳送給 Google:
- 錯誤對話方塊的詳細資料
- Android Studio 記錄。依序前往「Help」>「Show Log in Finder」。這樣可在 Finder 中顯示
idea.log
的位置。在記錄檔中搜尋「Submit Actions Request Body:」,然後貼上伺服器回應內容 (應會有動作的兩個結果)。
應用程式動作測試工具會產生 UnknownHostException
或其他網路錯誤
應用程式動作測試工具會建立應用程式動作預覽畫面,方便您使用單一 Google 帳戶測試 Google 助理的整合成果。如要建立這些預覽畫面,測試工具需要有效的網際網路連線,以及 Google 網域的 Proxy 存取權 (在必要情況下)。
如要解決執行測試工具時發生的網路問題,請確認下列常見問題:
使用測試外掛程式叫用應用程式動作時,Google 助理會說:「很抱歉,我找不到。」
視設定而定,系統可能會因不同原因而顯示此回應。請嘗試下列步驟:
- 使用相同的 Google 帳戶登入 Android Studio、Play 管理中心和測試裝置。
- 啟用裝置資料同步功能。
- 將裝置和 Google 助理的語言設為
en-US
。
- 確認 Google Play 管理中心的應用程式套件名稱與測試應用程式中的套件名稱相符。
- 在
actions.xml
檔案的執行要求 urlTemplate
定義中,請確認 android:host
和 android:scheme
的值與 AndroidManifest
檔案中宣告的值相符。
- 從測試裝置移除所有先前安裝的應用程式版本,然後安裝新的版本。
- 從應用程式動作測試工具中刪除預覽畫面,然後重新建立新的預覽畫面。
- 在 Logcat 工具中檢查是否有 Google 助理執行要求相關的失敗問題。您應該會看到應用程式已啟動的意圖。
- 針對該帳戶啟用「App info for your devices」設定。
- 開啟 Google 助理,並確實完成設定 (設定進度列通常會顯示為畫面底部的藍色列,但在某些情況下外觀可能不同)。
- 使用 Google 助理觸發應用程式動作時,請確認叫用名稱與應用程式動作測試工具建立的預覽相符。
- 嘗試使用文字輸入而非語音輸入,避免發生任何語音轉錄錯誤。
- 設定測試版本,使
applicationId
完全符合上傳至 Google Play 管理中心的 APK 或 AAB。請注意,選用的 applicationIdSuffix
屬性可變更特定變種版本和建構變化版本的最終 applicationId
。在此範例中,模擬變種版本的 applicationId
是 com.example.android.architecture.blueprints.master.mock
,而非 com.example.android.architecture.blueprints
。
- 設定預覽畫面以使用不重複的叫用名稱。請嘗試使用不重複的字詞,減少與其他應用程式發生衝突的機會。
- 如要在針對可共用程式碼集進行疑難排解時找出問題,請嘗試執行範例應用程式動作健身應用程式。請確保健身應用程式能夠進行端對端運作。接著,在這個應用程式中逐步加入其他功能,看看是否能重現問題。
- 如果您使用的是 G Suite 帳戶,請確認系統管理員已啟用 Google 助理。建議您改為建立非 G Suite 測試帳戶,並透過 Play 商店將該帳戶設為授權測試人員。測試人員應可透過該帳戶建立應用程式的預覽畫面,並在裝置上使用該帳戶完成測試。
- 如果您以個別應用程式的形式下載 Google 助理,請嘗試在裝置上強制停止 Google 助理。你通常可以透過手機的「設定」應用程式強制停止應用程式。
- 如果以上步驟都無法解決問題,請透過應用程式動作 Issue Tracker 回報問題。
這個頁面中的內容和程式碼範例均受《內容授權》中的授權所規範。Java 與 OpenJDK 是 Oracle 和/或其關係企業的商標或註冊商標。
上次更新時間: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"]],["上次更新時間: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)."]]