2

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 Answers2

2

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

Nick Fortescue
  • 13,530
  • 1
  • 31
  • 37
  • Thanks, just tried this but no success. Still shows the error - **Upload failed Your Instant App APKs should contain at least one base APK.** –  Dec 30 '17 at 10:04
  • It is looking for the APK who's gradle contains `baseFeature true`, that is the base APK. (and yes, the instant app APK(s) should be inside a zip file) https://developer.android.com/topic/instant-apps/getting-started/structure.html – TWL Dec 31 '17 at 03:58
0

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
sam33r
  • 245
  • 2
  • 16
  • Really appreciate you writing all that down, but as i've mentioned I compile using phonegap, meaning all my code is in HTML, CSS, JS and other web libraries. I'm not quite sure I can incorporate the above into my app directly, even in the config.xml file –  Jan 02 '18 at 16:18
  • You may have to reach out to Phonegap and see if they support Instant App development then. – TWL Jan 02 '18 at 16:53