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