【问题标题】:App linking verification failed on installation process安装过程中应用链接验证失败
【发布时间】:2019-08-16 13:29:11
【问题描述】:

我正在尝试为我的应用设置应用链接。该应用根据应用链接助手关联到网站,但由于某种原因,在安装过程中验证过程失败。

这是我的应用的意图过滤器

<intent-filter android:autoVerify="true">
  <action android:name="android.intent.action.VIEW" />
    <category android:name="android.intent.category.DEFAULT" />
    <category android:name="android.intent.category.BROWSABLE" />

    <data
      android:host="staging.lemonilo.com"
      android:scheme="https" />
</intent-filter>

我的assetlinks.json 的位置

https://staging.lemonilo.com/.well-known/assetlinks.json

使用 git bash 来自 catlog 的错误日志

08-16 10:34:41.738 15815 16129 I SingleHostAsyncVerifier: Verification result: checking for a statement with source a: # brgr@3ede8955
08-16 10:34:41.738 15815 16129 I SingleHostAsyncVerifier: w: 32
08-16 10:34:41.738 15815 16129 I SingleHostAsyncVerifier: , relation delegate_permission/common.handle_all_urls, and target b <
08-16 10:34:41.738 15815 16129 I SingleHostAsyncVerifier:   a: "com.lemonilo"
08-16 10:34:41.738 15815 16129 I SingleHostAsyncVerifier:   b: # brgp@8358a08
08-16 10:34:41.738 15815 16129 I SingleHostAsyncVerifier:   w: 113
08-16 10:34:41.738 15815 16129 I SingleHostAsyncVerifier: >
08-16 10:34:41.738 15815 16129 I SingleHostAsyncVerifier: w: 115
08-16 10:34:41.738 15815 16129 I SingleHostAsyncVerifier:  --> false.
08-16 10:34:41.738 15815  9034 I IntentFilterIntentOp: Verification 28 complete. Success:false. Failed hosts:staging.lemonilo.com.

【问题讨论】:

    标签: android


    【解决方案1】:

    首先,确保提供了 http 和 https 方案。甚至您的应用程序也仅捕获 http 或仅捕获 https。你可以这样组合:

                    <data
                        android:scheme="http"/>
                    <data
                        android:scheme="https"
                        android:host="yourbaseurl.com"
                        android:pathPrefix="/path"/>
    

    其次,确保 assetlinks.json 是您从 Android Studio App Link Assistant 导出的。

    第三,特别是对于 playstore 部署版本。确保添加正确的 sha256_cert_fingerprints,这是您的应用签名证书的 sha256 证书指纹,而不是您的上传证书(它在您的应用发布仪表板、发布管理 --> 应用签名中可用)

    您可以在一个资产链接中组合多个 sha256 指纹,用逗号分隔。比如这个:

    https://log.girilabs.com/.well-known/assetlinks.json

    【讨论】:

    • 尝试在意图过滤器上添加 http,仍然无法正常工作。有没有其他方法可以知道验证过程失败的原因?
    • 你试过从邮递员那里获取assetlinks文件吗?确保内容类型为application/json,确保遵循此处的指南:developer.android.com/training/app-links/…
    • 我也在这个问题上苦苦挣扎,在我的情况下,我发现了两种问题,第一种是内容类型是plain/text,因为我使用的是共享主机,自动更改json文件的内容类型,第二个是因为我放错了文件,我没有使用android studio生成的assetslink文件。
    • 您可以使用邮递员检查服务器返回的内容类型。
    • 尝试从邮递员获取,内容类型为application/json。我应该让assetlinks.json 可以通过http 访问吗?
    猜你喜欢
    • 2017-05-20
    • 1970-01-01
    • 1970-01-01
    • 2017-08-18
    • 2015-07-19
    • 1970-01-01
    • 2015-06-05
    • 2016-08-06
    • 1970-01-01
    相关资源
    最近更新 更多