【问题标题】:How Can I test Google Actions in Android app?如何在 Android 应用中测试 Google Actions?
【发布时间】:2019-07-05 11:14:27
【问题描述】:

在 Android Studio 中使用 App action test tools 测试 Google Actions,我收到了错误

Preview Creation Error Status Code: 400 Message: Precondition check failed.
The requested Android app package name does not have an associated project
 in Play Console. Please create a draft in Play Console and upload an app 
with package name 'com.example.yadayada'.

如果我尝试“使用包名上传应用程序...” 我收到了错误

Upload failed
You have uploaded an APK or Android App Bundle that contains an action schema 
document in the manifest file, but the action patterns are not yet allowed. 
If you participate in a beta program, you must obtain authorization 
for your developer account

好的,但是我在哪里以及如何做呢?

此外,我不必发布应用程序,这只是一个草稿,用于测试未来可能的 Slice 的实现,文档说明可以通过 Android Studio 插件来完成。

【问题讨论】:

    标签: android actions-on-google google-play-console app-actions


    【解决方案1】:

    好的,知道了。提示here

    在开发者控制台中创建一个新的应用程序没有操作,并使用 它在测试应用程序 with 操作中的包名称。您可以使用您已经在控制台中注册的任何包名称

    android {
        defaultConfig {
            applicationId "com.example.yadayada.playconsole"
        }
    }
    

    【讨论】:

    • 没什么帮助
    【解决方案2】:

    您需要将此添加到清单文件中:

    <meta-data
       android:name="android.app.shortcuts"
       android:resource="@xml/shortcuts" />
    

    这在应用操作教程和这里都有解释:https://developer.android.com/guide/topics/ui/shortcuts/creating-shortcuts#static

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-07-28
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多