4

I've been trying for a week to solve this issue with no luck! Google play is still not convinced that I have linked my website properly!, whenever I upload my instant app I get the usual:

Your site 'www.servstore.co' has not been linked through the Digital Asset Links protocol to your app. Please link your site through the Digital Asset Links protocol to your app.

Noting that both my instant app and installed app have the same code base (single module), and are actually 9.4 MB after minification.

I know this has been asked multiple times, and I've seen mutiple SO posts about this, however none of the resolutions I've read seem to work for me, I actually tried all of them so far with no luck, What I've done so far to debug this issue:

Website Side:

  1. Made sure assetlinks.json is uploaded to my website and administered with appropriate Content-Type header.

  2. Made sure the file is available with public permission (777)

  3. Made sure robots.txt allows crawling for the file, I actually only have the below in it:

User-Agent: *
Allow: /.well-known*
  1. Verified asset link https://digitalassetlinks.googleapis.com/v1/statements:list?source.web.site=https://www.servstore.co&relation=delegate_permission/common.handle_all_urls

  2. made sure the asset link is using the right SHA-256 (private key in Google Play), I also never use an upload key, I directly sign my app with the same key and have opted in to Google play signing using that key.

App Side:

  1. added asset_statements to my strings.xml and meta-data under application tag in AndroidManifest.xml

  2. Made sure the first intent-filter containing app link has auto-verify = true in my manifest, also tried to mark all 3 activities that have intent-filter URLs with auto-verify

  3. Added default-url in the manifest to all 3 activities and tried with only the main activity.

  4. Added networkSecurityConfig to xml resources and reference it in the manfiest:

<?xml version="1.0" encoding="utf-8"?>
<network-security-config>
    <domain-config cleartextTrafficPermitted="false">
        <domain includeSubdomains="true">www.servstore.co</domain>
    </domain-config>
</network-security-config>

In Google Play:

  1. Enabled instant-app release type in new Google Play console.

  2. published the same code to standard release type in Google Play with version code higher than the one I use for my instant app.

I am ready to try anything ..

here is my manfiest file, removing unrelated activities:

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:dist="http://schemas.android.com/apk/distribution"
    xmlns:tools="http://schemas.android.com/tools"
    package="co.servstore.client"
    android:targetSandboxVersion="2">

    <dist:module dist:instant="true" />

    <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
    <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.WAKE_LOCK" />
    <uses-permission android:name="android.permission.READ_PHONE_STATE" />

    <uses-feature
        android:glEsVersion="0x00020000"
        android:required="true"/>

    <application
        android:name=".ServStoreApp"
        android:allowBackup="false"
        android:icon="${appIcon}"
        android:label="@string/app_name"
        android:roundIcon="${appIconRound}"
        android:supportsRtl="true"
        android:theme="@style/Theme.ServeStore.NoActionBar"
        android:usesCleartextTraffic="true"
        tools:ignore="GoogleAppIndexingWarning"
        tools:replace="android:allowBackup,android:theme"
        android:networkSecurityConfig="@xml/network_security_config">

        <service
            android:name=".services.notifications.NotificationService"
            android:exported="false">
            <intent-filter>
                <action android:name="com.google.firebase.MESSAGING_EVENT" />
            </intent-filter>
        </service>

        <meta-data
            android:name="com.google.android.gms.version"
            android:value="@integer/google_play_services_version" />

        <meta-data
            android:name="com.google.android.geo.API_KEY"
            android:value="***" />

        <meta-data
            android:name="asset_statements"
            android:resource="@string/asset_statements" />

        <activity
            android:name=".ui.main.MainActivity"
            android:screenOrientation="nosensor"
            android:windowSoftInputMode="adjustResize|stateHidden">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
            <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="www.servstore.co"
                    android:scheme="https" />
                <data android:scheme="http" />
            </intent-filter>
            <meta-data
                android:name="default-url"
                android:value="https://www.servstore.co" />
        </activity>

        <activity
            android:name=".ui.orders.OrderDetailsActivity"
            android:screenOrientation="nosensor">
            <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="www.servstore.co"
                    android:path="/businessOrders"
                    android:scheme="https" />
                <data android:scheme="http" />
            </intent-filter>
            <meta-data
                android:name="default-url"
                android:value="https://www.servstore.co" />
        </activity>
        <activity
            android:name=".ui.orders.CustOrderDetailsActivity"
            android:screenOrientation="nosensor">
            <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="www.servstore.co"
                    android:path="/userOrders"
                    android:scheme="https" />
                <data android:scheme="http" />
            </intent-filter>
            <meta-data
                android:name="default-url"
                android:value="https://www.servstore.co" />
        </activity>
    </application>

</manifest>
Tomerikoo
  • 18,379
  • 16
  • 47
  • 61
Muhammad Alfaifi
  • 5,662
  • 2
  • 19
  • 23

3 Answers3

1

To resolve to a particular host url, you should provide the host.

Can you try to remove:

<data android:scheme="http" />

Or add host for the http scheme like below

<data
    android:host="www.servstore.co"
    android:scheme="http" />
Hendry Setiadi
  • 241
  • 1
  • 3
  • Sorry. My answer is not correct. giving android is definitely okay, because it will be merged with android:host. This is explained here https://developer.android.com/training/app-links/verify-site-associations#multi-host – Hendry Setiadi Mar 23 '21 at 06:28
0

I have had similar difficulties and am trying some things that might help you. Your problem might be a missing intermediary SSL certificate.

When you run the App Link Tester you probably are getting an error response "URL resolving conflicts, please link and verify your digital asset links"

If you then run Postman to connect to your domain (by https) you get an "SSL error: Unable to verify the first certificate". But you will find an HTTPS browser connection to a page on your server works fine.

In my case I understand from Sectigo that one intermediary certificate is installed with the SSL, but the second one is not. I would suggest that you call Sectigo tech support (888.391.4357). You may need guidance to get the missing intermediary certificate.

JAW
  • 187
  • 2
  • 13
0

You didn't include your build.gradle(app) so you might check your SDK versions. They may be tied up with the problems with the READ_PHONE_STATUS permission which you do require as reported in Google play not accepting instant app due to digital asset link

If you have simply accepted the addition implicitly, you might try removing it:

<uses-permission
    android:name="android.permission.READ_PHONE_STATE"
    tools:node="remove" />

That post also indicates problems with certain versions of play-services. Try:

implementation 'com.google.android.gms:play-services-base:17.6.0'
implementation 'com.google.android.gms:play-services-instantapps:17.0.0'
JAW
  • 187
  • 2
  • 13