繁体   English   中英

Android Instant App - Play控制台发布/部署错误和DAL(数字资产链接)未链接

[英]Android Instant App - Play Console release/deploy error and DAL(digital Asset Link) not linked

我试图找出游戏商店为什么不接受我的即时应用程序构建。 我已成功将Alpha常规应用程序版本部署到测试人员,因为它是发布即时应用程序的先决条件。 我正在尝试部署开发版即时应用程序。 我究竟做错了什么? 我试图尽可能多地添加细节。

我是否需要在以下链接中使用数字资产链接API服务来生成即时应用程序,还是其他内容? https://console.developers.google.com/apis/api/digitalassetlinks.googleapis.com/overview

将即时应用程序版本上传到播放控制台时出现以下错误:

您的网站“example.com”尚未通过数字资产链接协议链接到您的应用。 请通过Digital Assets Link协议将您的网站链接到您的应用。

我有点困惑的一件事是,为什么当我点击链接并验证是否收到错误消息“ 添加资产报表失败。 ”如下图所示: 添加资产报表失败 我注意到,当我点击链接和验证按钮,它修改strings.xml档案在和添加以下字符串: <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>

我在应用程序标记下的basechecklistadvisor 清单中有以下内容: <meta-data android:name="asset_statements" android:resource="@string/asset_statements"/>

项目描述和结构:

应用说明 :这是一个概念验证应用程序。 可安装的应用程序将使用两个按钮打开mainfeature活动,这些按钮将在您单击时显示清单或顾问程序活动。 有两个即时应用程序,instantapp-checklist进入清单活动,而instantapp(顾问)进入顾问活动。

  • 有3个功能模块:mainfeature,checklist,advisor
  • 有2个即时应用程序:instantapp-checklist,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.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"]
  }
}]

在我的清单中,活动标签内的清单如下:

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

自我检查我做了:

  • 即时应用程序已使用我的密钥库签名签名,而不是使用调试密钥签名。 我检查确保即时应用程序和assetlinks.json显示相同的sha256指纹。
  • robots.txt允许所有机器人搜索assetlinks.json
  • assetlinks.json确实有一个有效的证书并允许https
  • assetlinks.json标头的内容类型是application / json
  • 我不会选择“Google Play App Signing”
  • 我使用以下网站测试我的陈述并且成功: https//developers.google.com/digital-asset-links/tools/generator

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/"
  • 在设备上,我转到设置> Google>即时应用,然后点击切换到卸载/关闭即时应用,然后再次单击它以将其重新打开。 还转到了Chrome设置( 设置>隐私>清除浏览数据 )以清除时间范围内的所有数据,所有时间。
  • 在Chrome中输入即时应用的网址时,它只会打开网站,而不是即时应用。 如果我点击网站上即时应用程序的链接,它会打开即时应用程序而不是网站。

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

正如@ olearyj234中提到的Link和Verify按钮将字符串添加到string.xml的末尾。

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

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM