I'm trying to figure out why the play store will not accept my instant app build. I have successfully deployed an Alpha regular app release to testers since it is a prerequisite to release an instant app. I am trying to deploy a development release instant app. What am I doing wrong? I tried to add as much detail as possible.
Do I need to use the Digital Asset Link API service at the following link for a production instant app or is that for something else? https://console.developers.google.com/apis/api/digitalassetlinks.googleapis.com/overview
I get the following error when uploading the instant app build to the play console:
Your site 'example.com' has not been linked through the Digital Assets Link protocol to your app. Please link your site through the Digital Assets Link protocol to your app.
One thing i'm a little confused about is why when I click link and verify that a get the error message "Adding asset statements failed." as shown in the following picture:
I notice that when I click the link and verify button, it modifies the strings.xml file in base and adds the following string: <string name="asset_statements" translatable="false">[{\n \"relation\": [\"delegate_permission/common.handle_all_urls\"],\n \"target\": {\n \"namespace\": \"web\",\n \"site\": \"https://example.com\",\n }\n}]</string>
I have the following in the manifest of base, checklist and advisor under the application tag: <meta-data android:name="asset_statements" android:resource="@string/asset_statements"/>
Project description and structure:
App description: This is a proof of concept app. The installable app will open the mainfeature activity with two buttons that will bring you to either the checklist or advisor activity when clicked. There are two instant apps, instantapp-checklist goes to the checklist activity and instantapp(advisor) goes to the advisor activity.
- There are 3 feature modules: mainfeature, checklist, advisor
- There are 2 instant apps: instantapp-checklist, instantapp(advisor)
- My installable app's bundle is is: blah.blah1.blah2.myappname
- My checklist instant app's bundle id is: blah.blah1.blah2.myappname.checklist
- My advisor instant app's bundle id is: blah.blah1.blah2.myappname.advisor
My assetlinks.json is:
[{
"relation": ["delegate_permission/common.handle_all_urls"],
"target": {
"namespace": "android_app",
"package_name": "blah.blah1.blah2.myappname.checklist",
"sha256_cert_fingerprints":
["AA:...:53"]
}
},
{
"relation": ["delegate_permission/common.handle_all_urls"],
"target": {
"namespace": "android_app",
"package_name": "blah.blah1.blah2.myappname.advisor",
"sha256_cert_fingerprints":
["AA:...:53"]
}
}]
In my checklist manifest inside the activity tag is the following:
<meta-data
android:name="default-url"
android:value="https://example.com/checklist.html"/>
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
<intent-filter android:order="1"
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="http"
android:host="example.com"
android:pathPattern="/checklist.html"/>
<data android:scheme="https"/>
</intent-filter>
Self checks I've done:
- The instant app was signed signed with my keystore, not with the debug key. I checked to make sure the instant app's and the assetlinks.json show the same sha256 fingerprint.
- The robots.txt allows assetlinks.json to be searched by all robots
- assetlinks.json does have a valid cert and allows https
- The content-type of assetlinks.json header is application/json
- I am not opt'd in for "Google Play App Signing"
- I used the following site to test my statement and it is successful: https://developers.google.com/digital-asset-links/tools/generator
package_name
in yourassetlinks.json
. The package name should be the package name of the app itself:blah.blah1.blah2.myappname
– TWL