7

上传失败

您应该同时使用 http 和 https 作为您的网络意图过滤器的方案。

将即时应用程序上传到 Play 商店时出现此错误。我在 Manifest 中为 http 和 https 声明了意图过滤器,如下所示。

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

您能否让我知道可能出了什么问题以及为什么在上传到 Play 商店时出现此错误?

4

6 回答 6

6

尝试这样IntentFilter声明

<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>
于 2017-06-19T06:13:19.180 回答
1

您必须在同一个意图过滤器中定义两者

   <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>
于 2017-12-20T08:08:51.900 回答
1

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

有同样的问题。上面的清单解决了我的问题

于 2018-03-20T20:39:00.397 回答
1

不要在 Manifest 文件中自行更改意图过滤器代码。

只需转到工具 > 应用链接助手,然后按照 1 到 4 的步骤操作。

在第 1 步中,android studio 会自动将这些意图过滤器代码添加到您的清单文件中。

(来源:开发者文档 > 添加 Android 应用链接

按照链接中的步骤操作。

于 2017-07-01T07:47:47.973 回答
0

同意前面的回答,但也将 android:autoVerify="true" 添加到 intent-filter

于 2017-06-19T09:56:00.300 回答
0

我做了上面提到的所有事情,但在我的基本模块清单中添加这些权限后终于摆脱了这个错误。

<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
于 2017-10-25T10:33:23.110 回答