5

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: Adding asset statements failed 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)

Project structure

  • 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
4

2 回答 2

2

assetlinks.json文件中,字段package_name设置为blah.blah1.blah2.myappname.checklist

但是,上面提到的是可安装应用程序的 idblah.blah1.blah2.myappname。这意味着AndroidManifest.xml中的package_name设置为blah.blah1.blah2.myappname

他们应该匹配。blah.blah1.blah2.myappname必须添加到服务器上的assetlinks.json

strings.xml中,更改asset_statements:

<string name="asset_statements" translatable="false">[{\n  \"relation\": [\"delegate_permission/common.handle_all_urls\"],\n  \"target\": {\n    \"namespace\": \"web\",\n    \"site\": \"https://qaapps.cio.ny.gov/apps/sandbox/james/hesc/checklist.html\",\n  }\n},{\n  \"relation\": [\"delegate_permission/common.handle_all_urls\"],\n  \"target\": {\n    \"namespace\": \"web\",\n    \"site\": \"https://qaapps.cio.ny.gov/apps/sandbox/james/hesc/advisor.html\",\n  }\n}]</string>

以下是帮助我找到解决方案的其他一些注释:

  • 我使用以下命令行来测试即时应用程序是否有效:adb shell am start -a android.intent.action.VIEW -d "https://example.com/checklist/"
  • 在设备上,我转到“设置”>“谷歌”>“即时应用程序”并单击开关以卸载/关闭即时应用程序,然后再次单击以将其重新打开。还转到 Chrome 设置(设置>隐私>清除浏览数据)以清除时间范围内的所有数据,所有时间。
  • 在 Chrome 中输入免安装应用的网址时,它只会打开网站而不是免安装应用。如果我单击网站中的即时应用程序链接,它会打开即时应用程序而不是网站。
于 2017-09-01T15:32:45.233 回答
0

很奇怪,我也有同样的问题。解决方案很简单;

正如@olearyj234 提到的链接和验证按钮将字符串添加到string.xml 的末尾。

我只是删除了 string.xml 中的新字符串,然后单击“链接并验证”按钮。

于 2018-09-14T23:29:21.133 回答