You must use the http and https protocols for intent filters. Why receive this error message?

Viewed 2111

When I choosing to upload android Instant App apk-s zip to Google Play Developer Console I receive this error: Upload failed. You must use the http and https protocols for intent filters

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

3 Answers

I was using intent-filter to receive dynamic link but also was integrating deep link in navigation graph, for this reason it was also necessary to include "http" and "https" support in the nav_graph.xml document.

<fragment
        android:id="@+id/someFragment"
        android:name="com.apps.example.SomeFragment"
        android:label="fragment_some"
        tools:layout="@layout/fragment_some" >
        <deepLink
            android:id="@+id/deepLink1"
            app:uri="https://example.page.link" />

        <deepLink
            android:id="@+id/deepLink2"
            app:uri="http://example.page.link" />
  </fragment>
Related