Android Instant App-Play控制台发布/部署错误和未链接DAL(数字资产链接) [英] Android Instant App - Play Console release/deploy error and DAL(digital Asset Link) not linked

查看:102
本文介绍了Android Instant App-Play控制台发布/部署错误和未链接DAL(数字资产链接)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图弄清楚为什么Play商店不接受我的即时应用构建。我已经成功向测试人员部署了 Alpha 常规应用程序发布,因为这是发布即时应用程序的先决条件。我正在尝试部署开发发布即时应用程序。我究竟做错了什么?我尝试添加尽可能多的细节。



我是否需要在以下链接中使用Digital Asset Link API服务来生产生产型即时应用程序?其他?

我注意到当我单击链接并验证按钮时,它会修改 base 中的strings.xml文件并添加以下字符串:<字符串名称= 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>



清单中有以下内容 base 清单 advisor 放在应用程序标记下:<元数据android:name = asset_statements android:resource = @ string / asset_statements />



项目描述和结构:



应用说明:这是概念验证应用。可安装的应用程序将通过两个按钮打开mainfeature活动,单击它们会将您带到清单或顾问活动。即时应用程序有两个,instantapp-checklist进入清单活动,instantapp(advisor)进入顾问活动。




  • 共有3个功能模块:mainfeature,清单,顾问

  • 有2个即时应用:instantapp-清单,instantapp(顾问)






  • 我的可安装应用程序的捆绑包是:blah.blah1.blah2 .myappname

  • 我的清单即时应用程序的捆绑软件ID是:blah.blah1.blah2.myappname.checklist

  • 我的顾问即时应用程序的捆绑软件ID是:blah .blah1.blah2.myappname.advisor



我的assetlinks.json是:

  [{
relation:[ delegate_permission / common.handle_all_urls],
target:{
namespace: android_app ,
package_name: blah.blah1.b lah2.myappname.checklist,
sha256_cert_fingerprints:
[ AA:...:53]
}
},
{
关系:[ delegate_permission / common.handle_all_urls],
目标:{
命名空间: android_app,
package_name: blah.blah1.blah2。 myappname.advisor,
sha256_cert_fingerprints:
[ AA:...:53]
}
}]

在我活动清单内的清单中,

 <元数据
android:name =默认网址
android:value = https://example.com/checklist.html />

<意图过滤器>
< action android:name = android.intent.action.MAIN />

< category android:name = android.intent.category.LAUNCHER />
< / 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 />

<数据
android:scheme = http
android:host = example.com
android:pathPattern = / checklist.html / >
< data android:scheme = https />
< / intent-filter>

我完成的自检:




  • 即时应用程序是使用我的密钥库签名的,而不是使用调试密钥签名的。我检查以确保即时应用程序和assetlinks.json显示相同的sha256指纹。

  • robots.txt允许所有机器人搜索assetlinks.json

  • assetlinks.json确实具有有效的证书,并允许https

  • assetlinks.json标头的内容类型为application / json

  • 我没有选择使用 Google Play应用程序签名

  • 我使用以下网站来测试我的陈述,并且该陈述成功了: https://developers.google.com/digital-asset-links/tools/generator


解决方案

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



但是,上述是可安装应用的ID blah.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 \命名空间\:\ 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/

  • 在设备上,我转到设置> Google> Instant Apps ,然后单击切换为卸载/关闭即时应用程序,然后再次单击以将其重新打开。还进入了Chrome设置(设置>隐私>清除浏览数据),以清除时间范围内的所有数据,所有时间。

  • 在URL中键入以下内容: Chrome中的即时应用,它只会打开网站,而不会打开即时应用。如果我单击网站中指向即时应用程序的链接,则会打开即时应用程序而不是网站。


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

解决方案

In the assetlinks.json file, the field package_name is set to blah.blah1.blah2.myappname.checklist.

However, mentioned above is that the installable app's id is blah.blah1.blah2.myappname. That means the package_name in the AndroidManifest.xml is set to blah.blah1.blah2.myappname.

They should match. blah.blah1.blah2.myappname must be added to the assetlinks.json on the server.

In the strings.xml, change the 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>

Here are some other notes that helped me find the solution:

  • I used the following command line to test if the instant app works: adb shell am start -a android.intent.action.VIEW -d "https://example.com/checklist/"
  • On the device, I went to Settings > Google > Instant Apps and clicked the switch to uninstall/turn-off instant apps, then click it again to turn it back on . Also went to the Chrome settings(Settings > Privacy > Clear Browsing Data) to clear all data for time range, All Time.
  • When typing in the url to the instant app in Chrome, it only opens the website and not the instant app. If I click on a link to the instant app in a website it does open the instant app instead of the website.

这篇关于Android Instant App-Play控制台发布/部署错误和未链接DAL(数字资产链接)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆