Digital Assets Link link to my website

Kochchy picture Kochchy · Jun 12, 2017 · Viewed 10.2k times · Source

I have created an instant app. I uploaded it to my Google Console, and I got this error.

The www.kochchy.cz website has not been linked to your application through the Digital Assets Link protocol. Link the application site with 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"]
  }
}] 

Both apks, instant and installable use same id: com.kochchy.instantapptest.app (each defined in own module manifests)

My base module manifest looks like this:

<?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>

------ EDIT ------

I made new project from google instant app sample: https://github.com/googlesamples/android-instant-apps/tree/master/hello

Same google console error. I guess there is problem in my web setup, not in the app.

The www.kochchy.cz website has not been linked to your application through the Digital Assets Link protocol. Link the application site with Digital Assets Link.

Answer

swforlife picture swforlife · Oct 24, 2018

So for me, and maybe this is obvious to some, was the usage of the wrong sha key. What you need to do is go to your https://play.google.com/apps/publish/ console

Go to Release Management then to the App Signing page. Copy the SHA256 key from there.

Go to https://developers.google.com/digital-asset-links/tools/generator and enter the sha key, url and packagename there.

Upload this file to https://example.com/.well-known/assetlinks.json

Make sure that the file is in the correct location: A folder named .well-known.

Release your instant app