[英]Android Instant App - Play Console release/deploy error and DAL(digital Asset Link) not linked
[英]Google play not accepting instant app due to digital asset link
我已经尝试了一周来解决这个问题,但没有运气,谷歌播放仍然不相信我已经正确链接了我的网站:,每当我上传我的即时应用程序时,我都会得到通常的:
您的网站“www.servstore.co”尚未通过数字资产链接协议链接到您的应用程序。 请通过数字资产链接协议将您的网站链接到您的应用程序。
请注意,我的即时应用程序和已安装的应用程序具有相同的代码库(单个模块),并且在缩小后实际上是 9.4 MB。
我知道这个问题已经被问过很多次了,我也看过很多关于这个的帖子,但是我读过的所有决议似乎都不适合我,到目前为止,我实际上尝试了所有这些,但没有运气,我是什么到目前为止已经调试了这个问题:
网站方面:
确保assetlinks.json
上传到我的网站并使用适当的Content-Type header 进行管理。
确保文件在公共许可下可用 (777)
确保robots.txt
允许抓取文件,我实际上只有以下内容:
User-Agent: *
Allow: /.well-known*
确保资产链接使用正确的 SHA-256(Google Play 中的私钥),我也从不使用上传密钥,我直接使用相同的密钥对我的应用程序进行签名,并选择使用该密钥进行 Google Play 签名。
应用端:
将asset_statements
添加到我的strings.xml
和AndroidManifest.xml的应用程序标签下的元数据
确保包含应用程序链接的第一个意图过滤器在我的清单中具有auto-verify = true
,还尝试将所有具有意图过滤器 URL 的 3 个活动标记为自动验证
在清单中为所有 3 个活动添加了default-url
,并仅尝试使用主要活动。
将networkSecurityConfig
添加到 xml 资源并在 manfest 中引用它:
<?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>
在谷歌播放:
在新的 Google Play 控制台中启用了即时应用发布类型。
将相同的代码发布到 Google Play 中的标准发布类型,其版本代码高于我用于即时应用程序的版本代码。
我准备尝试任何东西..
这是我最重要的文件,删除了不相关的活动:
<?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>
要解析到特定主机 url,您应该提供主机。
您可以尝试删除:
<data android:scheme="http" />
或为 http 方案添加host
,如下所示
<data
android:host="www.servstore.co"
android:scheme="http" />
我也遇到过类似的困难,正在尝试一些可能对你有帮助的事情。 您的问题可能是缺少中介 SSL 证书。
当您运行 App Link Tester 时,您可能会收到错误响应“URL 解决冲突,请链接并验证您的数字资产链接”
如果您随后运行 Postman 连接到您的域(通过 https),您会收到“SSL 错误:无法验证第一个证书”。 但是您会发现 HTTPS 浏览器连接到服务器上的页面可以正常工作。
就我而言,我从 Sectigo 了解到,SSL 安装了一个中间证书,但第二个没有。 我建议您致电 Sectigo 技术支持 (888.391.4357)。 您可能需要指导以获取丢失的中介证书。
你没有包括你的 build.gradle(app) 所以你可以检查你的 SDK 版本。 他们可能与READ_PHONE_STATUS权限的问题有关
如果您只是隐式接受了添加,则可以尝试将其删除:
<uses-permission
android:name="android.permission.READ_PHONE_STATE"
tools:node="remove" />
该帖子还指出某些版本的播放服务存在问题。 尝试:
implementation 'com.google.android.gms:play-services-base:17.6.0'
implementation 'com.google.android.gms:play-services-instantapps:17.0.0'
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.