40

I want to disable instant run but the menu point is not there. I know where the instant run should be, but it is completely missing. I don't know why. I just upgraded to Android Studio 3.5 but I get an error when using AsyncTask and I know that the problem can be solved when disabling instant run, but I can't.

See the screenshot for better understandingclick

This is my gradle (app)

    apply plugin: 'com.android.application'


android {
    compileSdkVersion 29
    buildToolsVersion "29.0.0"
    defaultConfig {
        applicationId "com.project.myapp"
        minSdkVersion 21
        targetSdkVersion 29
        versionCode 13
        versionName "1.1"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"

    }
    buildTypes {
        debug {

            resValue "string", "google_maps_api_key", GoogleMapDebug
        }

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


        }
           }

    sourceSets { main { assets.srcDirs = ['src/main/assets', 'src/main/asset/'] } }
}

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
        exclude group: 'com.android.support', module: 'support-annotations'
    })

    implementation 'com.google.android.material:material:1.0.0'
    implementation 'androidx.appcompat:appcompat:1.0.2'
    implementation 'com.google.android.gms:play-services-location:12.0.1'
    implementation 'com.google.android.gms:play-services-maps:12.0.1'


    testImplementation 'junit:junit:4.12'
}


apply plugin: 'com.google.gms.google-services'
Blnpwr
  • 1,793
  • 4
  • 22
  • 43

4 Answers4

40

They removed Instant Run, replacing it with "Apply Changes". See the release blog post for more about the change. And the docs have more information about the nature of "Apply Changes".

CommonsWare
  • 986,068
  • 189
  • 2,389
  • 2,491
  • 1
    apply changes only works above android 8, they should bring back instant run for android 5 - 8. – Aman Jan 21 '20 at 00:18
  • 1
    @CommonsWare How to disable it? – void pointer Nov 19 '21 at 10:04
  • 1
    @voidpointer: I don't see an option to disable it outright. If your concern is the toolbar button, though, you should be able to edit the toolbar and remove it. Right-click on an open area of the toolbar and choose the "Customize" context menu option. Then, search on "Apply". – CommonsWare Nov 19 '21 at 13:01
9

in version 3.5 it looks like...

like this

Kirguduck
  • 748
  • 1
  • 9
  • 20
  • 2
    So, no possibility to disable this? – Blnpwr Aug 22 '19 at 20:19
  • 1
    @Blnpwr: I did not see one in Settings when I looked for it an hour ago. You should be able to remove those toolbar buttons if they make you concerned, though -- right-click over a open spot in the toolbar and choose "Customize Menus and Toolbars" from the context menu. – CommonsWare Aug 22 '19 at 20:22
1

If you use the "Green Arrow" (Run app), Apply Changes will not trigger. And since "Apply Changes" does not alter the generated APKs there is no point "disabling" it.

  • If you click Run App, a normal APK is generated, installed and run. Instant Run is not invoked.
  • If you click "Apply Changes" or "Apply Code Changes", a normal APK is generated, installed and then Apply Changes triggers via class swapping.
Fabien
  • 321
  • 2
  • 7
0

It's here but you need Virtual Device or Smartphone with API 8 or more ... enter image description here