我已经创建了一个即时应用程序。我把它上传到我的Google控制台,我得到了这个错误。
www.kochchy.cz网站尚未通过数字资产链接协议链接到您的应用程序。将应用程序站点与数字资产链接链接。
[{
"relation": ["delegate_permission/common.handle_all_urls"],
"target": {
"namespace": "android_app",
"package_name": "com.kochchy.instantapptest.app",
"sha256_cert_fingerprints":["A4:A6:74:15:F1:3E:38:3F:93:0F:EF:E3:A6:86:8E:7C:25:45:E8:80:5B:5E:35:70:49:20:DB:F8:CB:D4:FC:E0"]
}
}] 即时和可安装的apks都使用相同的id:com.kochchy.instantapptest.app (每个在自己的模块清单中定义)
我的基本模块清单如下所示:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.kochchy.instantapptest">
<uses-permission android:name="android.permission.INTERNET" />
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:theme="@style/AppTheme">
<activity
android:name=".MainActivity"
android:label="@string/app_name"
android:theme="@style/AppTheme.NoActionBar">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<meta-data
android:name="default-url"
android:value="https://www.kochchy.cz" />
<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:scheme="https" />
<data android:scheme="http" />
<data android:host="www.kochchy.cz" />
<data android:pathPattern="/menu" />
</intent-filter>
</activity>
</application>
</manifest>我在google即时应用程序示例:https://github.com/googlesamples/android-instant-apps/tree/master/hello上做了一个新项目
同样的谷歌控制台错误。我想我的网络设置有问题,而不是在应用程序中。
www.kochchy.cz网站尚未通过数字资产链接协议链接到您的应用程序。将应用程序站点链接到数字资产链接.
发布于 2018-10-24 09:56:07
所以对我来说,也许这一点对某些人来说是显而易见的,那就是使用错误的沙键。您需要做的是转到您的https://play.google.com/apps/publish/控制台
转到,然后转到App页面。从那里复制SHA256密钥。
转到https://developers.google.com/digital-asset-links/tools/generator,在那里输入沙键、url和packagename。
将此文件上载到https://example.com/.well-known/assetlinks.json
确保文件位于正确的位置:一个名为.well-known的文件夹。
发布即时应用程序
发布于 2017-06-12 17:40:20
在json文件中,字段com.kochchy.instantapptest.app.设置为package_name。
但是,您的com.kochchy.instantapptest.中的包名设置为AndroidManifest.xml。
他们应该匹配。
编辑
您的结构看起来与Google推荐的结构非常不同。
您不应该重复代码和资源。相反,创建第三个模块(让我们称之为基本模块)作为基本功能模块,并将所有代码和资源移到那里。确保它的build.gradle包括以下行:
apply plugin: 'com.android.feature'
android {
baseFeature true
...
}
dependencies {
application project(':app')
...
}在您的应用程序的build.gradle中,请确保有以下几行:
apply plugin: 'com.android.application'
...
dependencies {
implementation project(':base')
}最后,在实例化的build.gradle中:
apply plugin: 'com.android.instantapp'
...
dependencies {
implementation project(':base')
}您可能需要做进一步的更改,但这应该是一个好的开始。我强烈建议您看看此页,特别是“基本即时应用程序的结构”一节。
发布于 2017-06-13 12:54:39
"package_name": "com.kochchy.instantapptest.app"在这里,您应该从可安装应用程序获得应用程序Id,而不是从即时应用程序清单中获得应用程序Id。
defaultConfig {
applicationId "com.example.yourappid"
}https://stackoverflow.com/questions/44497929
复制相似问题