You should have at least one active APK that is mapped to site 'sample.com' via a web 'intent-filter'

一曲冷凌霜 提交于 2019-11-28 04:26:39

问题


Trying to upload instant application but getting this error

You should have at least one active APK that is mapped to site 'sample.com' via a web 'intent-filter'.

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

回答1:


Upload installable APK in alpha, beta or production with same HOST web 'intent-filter'.




回答2:


You are defining an Intent filter with the scheme and host:

<data android:scheme="http" />
<data android:host="sample.com" />

so you have to access your deep links with

http://sample.com

but this domain must be a valid domain, and this domain must be of your property because you need to add the assetlinks.json

The website www.example.com publishes a statement list at https://www.example.com/.well-known/assetlinks.json. This is the official name and location for a statement list on a site; statement lists in any other location, or with any other name, are not valid for this site. In our example, the statement list consists of one statement, granting its Android app the permission to open links on its site:

[{
  "relation": ["delegate_permission/common.handle_all_urls"],
  "target" : { "namespace": "android_app", "package_name": "com.example.app",
               "sha256_cert_fingerprints": ["hash_of_app_certificate"] }
}]

Read more about it:

https://developers.google.com/digital-asset-links/v1/getting-started#quick-usage-example




回答3:


Instant apps does not support HTTP. Your default-url should be HTTPS

<meta-data
        android:name="default-url"
        android:value="https://sample.com/base-app/salt_one" />



回答4:


Your app must also define a default URL for your app. Within the same Android manifest as your entry-point activity, you define the default URL for your app by adding a element with a value attribute that provides a valid HTTPS URL that the activity can handle. Further, this default url must also be part of the CATEGORY_LAUNCHER activity's intent filter in the installed app.

The following code snippet shows an Android manifest that defines an entry-point activity and default URL for an instant app.

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

Instant apps does not support HTTP. Your default-url should be HTTPS

For more details can you check android AIA documentation.

There is some inappropriate string for error message, can you ensure fix with, installable APK in alpha, beta or production with same HOST web 'intent-filter'.



来源:https://stackoverflow.com/questions/47909531/you-should-have-at-least-one-active-apk-that-is-mapped-to-site-sample-com-via

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!