上传失败:您的即时应用APK至少应包含一个基本APK [英] Upload failed: Your Instant App APKs should contain at least one base APK

查看:60
本文介绍了上传失败:您的即时应用APK至少应包含一个基本APK的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要准备一个Instant App的Alpha测试,它在Android Studio上的运行非常吸引人,但是当我尝试将其上传到PlayStore时失败了,说:

I need to prepare an Alpha testing for an Instant App and It run like a charm on Android Studio but It is failing when I try to upload it to the PlayStore, saying:

上传失败

您的Instant App APK应该至少包含一个基本APK.

Your Instant App APKs should contain at least one base APK.

应用程序的结构使用三个模块完成:

The app structure is done using three modules:

-基本:它包含所有代码

- apk :包装器以获取可安装的apk

-apk: Wrapper to obtains the installable apk

- instantApp :包装器以获取InstantApp apk

-instantApp: Wrapper to obtain the instantApp apk

这是build.gradles:

This are the build.gradles:

base/build.gradle

buildscript {
    repositories {
        jcenter()
    }
}
apply plugin: 'com.android.feature'

repositories {
    jcenter()
    mavenCentral()
    flatDir {
        dirs 'libs'
    }
    maven { url 'https://maven.fabric.io/public' }
}

android {
    compileSdkVersion 25
    buildToolsVersion "26.0.0-rc2"

    baseFeature = true
    dataBinding {
        enabled = true
    }

    defaultConfig {

        minSdkVersion 18
        targetSdkVersion 25
        versionCode 7
        versionName "1.1"
    }

    signingConfigs {
        release {
            [...]
        }
    }

    buildTypes {
        debug {
            [...]
        }
        release {
            minifyEnabled false
            signingConfig signingConfigs.release
            [...]
        }
    }

    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }

    lintOptions {
        abortOnError false
    }

    dexOptions {
        javaMaxHeapSize "4g"
    }
}

dependencies {

    application project(":apk")
    [...]
}
apply plugin: 'com.google.gms.google-services'

apk/build.gradle

apply plugin: 'com.android.application'

android {
    compileSdkVersion 25
    buildToolsVersion "26.0.0-rc2"

    dataBinding {
        enabled true
    }

    defaultConfig {
        applicationId "…"
        minSdkVersion 18
        targetSdkVersion 25
        versionCode 7
       versionName "1.1"
    }

    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }

    signingConfigs {
        release {
            [...]
        }
    }

    buildTypes {
        debug {
            […]
        }
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'

            signingConfig signingConfigs.release
            […]
        }
    }
}

dependencies {
    implementation project(':base')
}

instantApp/build.gradle

apply plugin: 'com.android.instantapp'

dependencies {
    implementation project(':base')
}

这是清单文件

base/Manifest.xml

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="…">

<uses-permission android:name="android.permission.INTERNET" />
[…]

<application
    android:name="[…].TrgApplication"
    android:allowBackup="true"
    android:icon="@mipmap/ic_launcher"
    android:label="@string/app_name"
    android:theme="@style/AppBaseTheme">

    <activity
        android:name="[…].LauncherActivity"
        android:screenOrientation="portrait">
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />
            <category android:name="android.intent.category.LAUNCHER" />
        </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="[domain]" />
        </intent-filter>
    </activity>
    <activity
        android:name="[…].RootActivity"
        android:screenOrientation="portrait"
        android:windowSoftInputMode="adjustPan" />

    <activity
        android:name="[…].OnBoardingActivity"
        android:screenOrientation="portrait"
        android:windowSoftInputMode="adjustResize" />

    <activity
        android:name="[…].LocationPickerActivity"
        android:screenOrientation="portrait"
        android:windowSoftInputMode="adjustPan" />

    <meta-data
        android:name="com.google.android.gms.version"
        android:value="@integer/google_play_services_version" />

    <service android:name="com.parse.PushService" />
    <receiver
        android:name="com.parse.GcmBroadcastReceiver"
        android:permission="com.google.android.c2dm.permission.SEND">
        <intent-filter>
            <action android:name="com.google.android.c2dm.intent.RECEIVE" />
            <action android:name="com.google.android.c2dm.intent.REGISTRATION" />

            <!--
              IMPORTANT: Change "com.parse.starter" to match your app's package name.
            -->
            <category android:name="[…]" />
        </intent-filter>
    </receiver>

    <meta-data
        android:name="com.parse.push.gcm_sender_id"
        android:value="id:[…]" />

</application>
</manifest>

apk/Manifest.xml

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="..." />

此软件包与应用程序的软件包不同

This package is different that the app's one

我已经尝试过此解决方案:( Android Instant-release build not包括基本的APK ),但没有用.

I already tried this solution: (Android Instant-release build not includes base APK) but it didn't work.

自上个星期五以来我一直处于困境,所以任何想法都很棒

I m stuck since the last Friday so any kind of idea could be awesome

预先感谢

P.D:这是我的第一个问题,对不起,如果我做得不好,我很抱歉;)

P.D: Its my first question so I m sorry if I didn't do it propertly ;)

推荐答案

是的!我发现了问题!!!!(并且在任何Google帮助文档中都没有)

Yeah!!! I found the issue!!!!(and its not in any of the google help documents)

问题是我立即删除了InstantApp apk文件.解决方案是使用InstantApp apk和基本apk创建一个zip文件,然后删除该zip文件!!!

The issue was that I was dropping the instantApp apk file straight away. The solution is to create a zip file with the instantApp apk and the base apk and drop that zip file!!!

感谢您的帮助!!!最后,问题不是gradle或代码.它是PlayStore:)

Thanks for your help!!! At the end the issue wasnt gradle or the code..it was the PlayStore :)

我希望如果有人遇到同样的问题,这个问题可以帮助他们!

I hope that if anyone has the same problem this question can help them!!!

这篇关于上传失败:您的即时应用APK至少应包含一个基本APK的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆