【问题标题】:Instant app upload failed - both http and https as schemes should be即时应用上传失败 - http 和 https 作为方案应该是
【发布时间】:2019-10-03 09:42:59
【问题描述】:

当我尝试为即时应用上传我的 .aab 时,我收到以下错误:

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

我尝试使用网络意图过滤器声明我的 SplashActivity 的多个版本,但没有一个被 Google Play 接受。这是我从 .aab 中读取的最终 AndroidManifest.xml。

<activity
            android:name="com.xxx.SplashActivity"
            android:label="@string/app_name"
            android:launchMode="singleTask"
            android:screenOrientation="portrait"
            android:theme="@style/Theme.AppCompat.NoActionBar"
            android:windowSoftInputMode="adjustNothing" >
            <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://test.static.freeworld.cloud/start" />

            <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="@string/scheme" />
                <data android:host="@string/app_local_host" />
                <data android:pathPrefix="/start" />
                <data android:pathPrefix="/station" />
            </intent-filter>
            <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" />
                <data android:scheme="https" />
                <data android:host="test.static.freeworld.cloud" />
                <data android:pathPrefix="/start" />
            </intent-filter>
        </activity>

对此有什么帮助吗?

【问题讨论】:

  • &lt;data android:scheme="@string/scheme" /&gt; 什么是字符串/方案?
  • 这是我将用于应用导航的不同 URI。就像 myapp://go.app/start
  • 您可以尝试在没有该意图过滤器的情况下重新上传吗?或尝试将其与其他带有 http/https 方案的意图过滤器结合使用。
  • 我完全删除了它,但仍然出现同样的错误:(
  • 如果您仍然遇到此问题,那么您应该向 Google 的 Instant Apps 组件@issuetracker.google.com/issues/… 提交文件,确保提供受影响的 AAB 文件。

标签: android android-intent android-instant-apps


【解决方案1】:

不确定这是否能解决您的问题,但我在上传我们的即时应用 (.aab) 时也遇到了问题。在我们的案例中,我们收到了错误,您不能在即时启用的模块中使用自定义方案意图过滤器。

您可以尝试使用 bundletool (https://developer.android.com/studio/command-line/bundletool) 来验证您的 .aab 包是否已正确转换为 .apk 文件。

或者,您也可以使用免安装应用验证工具(位于 osx 上的~/Library/Android/sdk/extras/google/instantapps/ia)来验证您的免安装应用。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2022-01-21
    • 2019-02-27
    • 2019-08-14
    • 1970-01-01
    • 2017-01-31
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多