Android Studio 3.5中缺少即时运行功能

40

我想禁用即时运行,但是菜单里没有这个选项。我知道即时运行应该在哪里,但它完全消失了。我不知道原因。我刚升级到Android Studio 3.5,但在使用AsyncTask时出现错误,我知道问题可以通过禁用即时运行来解决,但我无法找到选项。

请参考屏幕截图以更好地理解click

这是我的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'
4个回答

40
他们移除了Instant Run,并用“应用更改”替换它。有关此更改的更多信息,请参见发布博客文章文档中有关于“应用更改”性质的更多信息。

1
应用更改仅适用于Android 8及以上版本,他们应该为Android 5-8恢复即时运行。 - Aman
1
@CommonsWare 怎么禁用它? - void pointer
1
@voidpointer:我没有看到直接禁用它的选项。但是,如果您担心的是工具栏按钮,您应该能够编辑工具栏并将其删除。右键单击工具栏的空白区域,选择“自定义”上下文菜单选项。然后,在搜索框中输入“应用”。 - CommonsWare

9
在3.5版本中,看起来是这样的... like this

2
那么,没有禁用这个的可能性吗? - Blnpwr
1
@Blnpwr:一个小时前我在设置中没有看到它。如果那些工具栏按钮让你担心,你应该能够移除它们——右键单击工具栏中的空白区域,然后从上下文菜单中选择“自定义菜单和工具栏”。 - CommonsWare

1
如果你使用“绿箭头”(运行应用程序),则不会触发“应用更改”。而且由于“应用更改”不会改变生成的APK,因此“禁用”它是没有意义的。
  • 如果你点击“运行应用程序”,将会生成、安装和运行一个普通的APK。不会调用Instant Run。
  • 如果你点击“应用更改”或“应用代码更改”,将会生成、安装一个普通的APK,然后通过类交换触发“应用更改”。

0

它在这里,但您需要具有API 8或更高版本的虚拟设备或智能手机... 输入图像描述


网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接