数字资产链接链接到我的网站

Koc*_*chy 5 android google-console-developer android-instant-apps

我已经创建了一个即时应用程序。我将其上传到我的Google控制台,但出现此错误。

www.kochchy.cz网站尚未通过数字资产链接协议链接到您的应用程序。将应用程序站点与Digital Assets Link链接。

[{
  "relation": ["delegate_permission/common.handle_all_urls"],
  "target": {
   "namespace": "android_app",
    "package_name": "com.kochchy.instantapptest.app",
    "sha256_cert_fingerprints":["A4:A6:74:15:F1:3E:38:3F:93:0F:EF:E3:A6:86:8E:7C:25:45:E8:80:5B:5E:35:70:49:20:DB:F8:CB:D4:FC:E0"]
  }
}] 
Run Code Online (Sandbox Code Playgroud)

即时和可安装的两个APK都使用相同的ID:com.kochchy.instantapptest.app(每个都在自己的模块清单中定义)

我的基本模块清单如下所示:

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.kochchy.instantapptest">

<uses-permission android:name="android.permission.INTERNET" />

<application
    android:allowBackup="true"
    android:icon="@mipmap/ic_launcher"
    android:label="@string/app_name"
    android:roundIcon="@mipmap/ic_launcher_round"
    android:theme="@style/AppTheme">

    <activity
        android:name=".MainActivity"
        android:label="@string/app_name"
        android:theme="@style/AppTheme.NoActionBar">
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />

            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>

        <meta-data
            android:name="default-url"
            android:value="https://www.kochchy.cz" />

        <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:scheme="https" />
            <data android:scheme="http" />
            <data android:host="www.kochchy.cz" />
            <data android:pathPattern="/menu" />
        </intent-filter>
    </activity>
</application>
</manifest>
Run Code Online (Sandbox Code Playgroud)

------编辑------

我从Google Instant App示例中创建了新项目:https://github.com/googlesamples/android-instant-apps/tree/master/hello

相同的Google控制台错误。我猜我的网络设置存在问题,而不是应用程序。

www.kochchy.cz网站尚未通过数字资产链接协议链接到您的应用程序。将应用程序站点与Digital Assets Link链接。

小智 9

所以对我来说,也许对某些人来说这很明显是使用错误的sha键。您需要做的是转到https://play.google.com/apps/publish/控制台

转到发布管理,然后转到“应用程序签名”页面。从那里复制SHA256密钥。

转到https://developers.google.com/digital-asset-links/tools/generator并在其中输入sha键,URL和程序包名称。

将此文件上传到 https://example.com/.well-known/assetlinks.json

确保文件位于正确的位置:名为的文件夹.well-known。

发布您的即时应用

  • 有趣的是,一位开发人员的解释与谷歌文档相比是多么简单。 (4认同)
  • 现在 SHA256 密钥不在“应用程序签名”页面中,而是在“设置”-&gt;“应用程序完整性”下 (2认同)