您必须对意图过滤器使用 http 和 https 协议。为什么会收到此错误消息?

Hay*_*ayk 5 android android-intent android-instant-apps

当我选择将 android Instant App apk-s zip 上传到 Google Play Developer Console 时,我收到此错误:上传失败。您必须对意图过滤器使用 http 和 https 协议

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
      xmlns:tools="http://schemas.android.com/tools"
      package="com.example.feature">

<application>
    <meta-data
        android:name="asset_statements"
        android:resource="@string/asset_statements"/>
    <activity android:name=".ui.MainActivity">
        <tools:validation testUrl="https://com.example/"/>

        <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="https"
                android:host="com.example"
                android:pathPattern="/.*"/>
        </intent-filter>

        <meta-data
            android:name="default-url"
            android:value="https://com.example"/>
    </activity>
</application>
Run Code Online (Sandbox Code Playgroud)

小智 1

确保您intent-filter至少具有以下属性。“http”和“https”方案必须同时存在:

         <intent-filter
            android:autoVerify="true"
            android:order="1">
            <action android:name="android.intent.action.VIEW" />
            <category android:name="android.intent.category.BROWSABLE" />
            <category android:name="android.intent.category.DEFAULT" />
            <data android:host="abc.com" />
            <data android:pathPattern="/def" />
            <data android:scheme="https" />
            <data android:scheme="http" />
        </intent-filter>
Run Code Online (Sandbox Code Playgroud)