Search code examples
androidsandboxandroid-instant-apps

When publish Instant App:Invalid target sandbox version


I try to publish the Android Instant App via Google Play. I might following problem enter image description here

I try to solve this problem by adding the attribute android:targetSandboxVersion = "2", still not work.

In general, the problem has these settings(build.gradle)

buildscript {

    repositories {
        maven { url 'https://maven.google.com' }
        jcenter()
        google()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.0.0-beta5'

        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        maven { url 'https://maven.google.com' }
        jcenter()
        google()
    }
}


ext {
    minSdkVersion = 26
    targetSdkVersion = 26
    compileSdkVersion = 26
    buildToolsVersion = '26.0.1'
    androidSupport = '26.0.0'
    versionCode = 5
    versionName = "1.1"
}

task clean(type: Delete) {
    delete rootProject.buildDir
}

======

As commented, I revise the base feature by adding the statement android:targetSandboxVersion = "2", then I cannot go through the compiling as errors shown, even if I clean, rebuild the project.

enter image description here


Solution

  • Updated answer:

    This was a bug that has since been fixed. You no longer need to add targetSandboxVersion to your installable app, and I don't recommend doing so, since the feature isn't yet documented or described anywhere.

    When I recommended adding the attribute originally, I believed that documentation would be forthcoming, before the release of an O phone. Instead, the team responsible for adding this validation realized their mistake.

    However, you do still need targetSandboxVersion in your instant app. Since we don't allow instant apps without that attribute, just consider it a required magic phrase.


    Original answer:

    As the message says, you need targetSandboxVersion in the manifest of your published installable app.

    Doing so places some restrictions on your installed app on O devices, and that makes it easier for the O installer to upgrade your instant app to installed.