Upload failed You should use both http and https as schemes for your web intent-filters

妖精的绣舞 提交于 2019-12-13 15:11:11

问题


Upload failed

You should use both http and https as schemes for your web intent-filters.

I am getting this error while uploading the instant app to Play Store. I have declared intent filters for both http and https in Manifest as below.

<intent-filter>
                <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"
                    android:host="XXXX" />
            </intent-filter>
            <intent-filter>
                <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="XXXX" />
            </intent-filter>

Could you please let me know what could be wrong and why i am getting this error while uploading to Play Store ?


回答1:


Try to declare IntentFilter like this

<intent-filter>
    <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="yourhost.ru" />
    <data android:pathPattern="/featurePath" />
</intent-filter>



回答2:


you have to define both in the same intent filter

   <intent-filter>  
        <action android:name="android.intent.action.VIEW" />
        <category android:name="android.intent.category.DEFAULT" />
        <category android:name="android.intent.category.BROWSABLE" />

        <data
            android:host="XXXX"
            android:scheme="http" />

        <data
            android:scheme="https"
            android:host="XXXX" />
    </intent-filter>



回答3:


Don't change your intent filter code by your own in the Manifest file.

Just go to Tools > App Links Assistants and follow the steps from 1 to 4.

In step 1 itself android studio will automatically add those intent filter codes to your manifest file.

(Source : Developer Documentation > Add Android App Links )

Follow the steps from the link.




回答4:


Agrees with the previous answer, but also add android:autoVerify="true" into intent-filter




回答5:


I did everything mentioned above but finally get rid of this error after adding these permissions in my base module's manifest.

<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />



回答6:


        <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"
                android:host="XYZ"
                android:pathPattern="/app" />

            <data
                android:scheme="https"
                android:host="XYZ"
                android:pathPattern="/app" />
        </intent-filter>
        <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://XYZ/app" />
    </activity>

Had the same problem. The above manifest solved my problem



来源:https://stackoverflow.com/questions/44621165/upload-failed-you-should-use-both-http-and-https-as-schemes-for-your-web-intent

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