Failed to submit instant app on play store - Base APK error

969 Views Asked by At

I was trying to submit an apk of mine to the play store instant app section when i get the error - Your Instant App APKs should contain at least one base APK.

Now, the app was compiled using phonegap and phonegap provides only one APK which I have submitted to the play store. I have read several documentations and other similar Qs but I can't find a solution to this.

The APK i am trying to submit as an Instant App is well under the 4mb limit and is properly signed too.

Any help would be appreciated.

EDIT : Tried submitting a zip too, no success. Is there anything specific the apk should be called or is instantApp fine?

2

There are 2 best solutions below

2
Nick Fortescue On

The upload for an instant app should be a "Bundle" which Android Studio will create for you, it isn't just a single APK.

If you are trying to create using phonegap, it might work if you create a Zip file which contains your APK (not just renaming your APK to a zip).

So upload "instant.zip" which contains your apk "instant.apk"

It is also looking for the APK who's gradle contains baseFeature true, that is the base APK. See the docs

2
sam33r On

As TWL said, you might not have declared your module as base module. Here is how my build.gradle for base module looks like.

apply plugin: 'com.android.feature'

android {
    compileSdkVersion rootProject.compileSdk
    buildToolsVersion rootProject.buildTools

    defaultConfig {
        minSdkVersion rootProject.minSdk
        targetSdkVersion rootProject.compileSdk
        versionCode rootProject.versionCode
        versionName rootProject.versionName
    }

    buildTypes {
        release {
            minifyEnabled true
            proguardFiles 'proguard-rules.pro', getDefaultProguardFile('proguard-android-optimize.txt')
        }
    }

    baseFeature true
}

You have to do two things.

  1. apply com.android.feature plugin
  2. set baseFeature true inside android block