尝试上传即时应用程序,但收到此错误
您应该至少有一个活动的APK通过网络'intent-filter'映射到网站'sample.com'。
<activity
android:name=".ui.InstantSplash"
android:screenOrientation="portrait"
android:theme="@style/splashScreenTheme">
<meta-data
android:name="default-url"
android:value="https://sample.com/base-app/salt_one" />
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<intent-filter
android:autoVerify="true"
tools:targetApi="m">
<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" />
<data android:host="sample.com" />
<data android:pathPrefix="/base-app" />
<data android:scheme="https" />
</intent-filter>
</activity>
使用相同的HOST网络'intent-filter'上传可安装的APK in alpha,beta或production。
您正在使用方案和主机定义Intent过滤器:
<data android:scheme="http" />
<data android:host="sample.com" />
所以你必须访问你的深层链接
http://sample.com
但是此域必须是有效域,并且此域必须属于您的属性,因为您需要添加assetlinks.json
www.example.com网站在https://www.example.com/.well-known/assetlinks.json发布了一份声明列表。这是网站上的声明列表的正式名称和位置;任何其他位置或任何其他名称的语句列表对此站点无效。在我们的示例中,语句列表包含一个语句,授予其Android应用程序在其站点上打开链接的权限:
[{ "relation": ["delegate_permission/common.handle_all_urls"], "target" : { "namespace": "android_app", "package_name": "com.example.app", "sha256_cert_fingerprints": ["hash_of_app_certificate"] } }]
阅读更多相关信息:
https://developers.google.com/digital-asset-links/v1/getting-started#quick-usage-example
即时应用不支持HTTP。您的default-url应该是HTTPS
<meta-data
android:name="default-url"
android:value="https://sample.com/base-app/salt_one" />
您的应用还必须为您的应用定义默认网址。在与入口点活动相同的Android清单中,您可以通过添加具有值属性的元素来定义应用程序的默认URL,该属性提供活动可以处理的有效HTTPS URL。此外,此默认URL还必须是已安装应用程序中CATEGORY_LAUNCHER活动的intent过滤器的一部分。
以下代码段显示了Android清单,该清单定义了即时应用的入口点活动和默认URL。
<activity
android:name=".MainActivity">
<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:scheme="http" />
<data android:scheme="https" />
<data android:host="example.com" />
</intent-filter>
<meta-data
android:name="default-url"
android:value="https://www.example.com/index.html" />
</activity>
即时应用不支持HTTP。您的default-url应该是HTTPS
有关更多详细信息,请查看android AIA documentation。
有一些不恰当的错误消息字符串,你可以确保使用相同的HOST网络'intent-filter'修复,安装APK在alpha,beta或生产中。