【问题标题】:Instant run is missing in Android Studio 3.5Android Studio 3.5 中缺少即时运行
【发布时间】:2019-08-22 20:10:24
【问题描述】:

我想禁用即时运行,但菜单点不存在。我知道即时运行应该在哪里,但它完全不见了。我不知道为什么。我刚刚升级到 Android Studio 3.5,但是在使用 AsyncTask 时出现错误,我知道禁用即时运行时可以解决问题,但我不能。

看截图更好理解

这是我的 gradle(应用程序)

    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'

【问题讨论】:

    标签: android


    【解决方案1】:

    他们删除了 Instant Run,将其替换为“应用更改”。有关更改的更多信息,请参阅the release blog postthe docs 有更多关于“应用更改”性质的信息。

    【讨论】:

    • 应用更改仅适用于 android 8 以上,它们应该为 android 5 - 8 带来即时运行。
    • @CommonsWare 如何禁用它?
    • @voidpointer:我没有看到完全禁用它的选项。但是,如果您关心的是工具栏按钮,您应该能够编辑工具栏并将其删除。右键单击工具栏的空白区域并选择“自定义”上下文菜单选项。然后,搜索“应用”。
    【解决方案2】:

    在 3.5 版本中看起来像...

    【讨论】:

    • 那么,不可能禁用这个吗?
    • @Blnpwr:一小时前我在“设置”中没有看到它。不过,如果这些工具栏按钮让您担心,您应该可以删除它们——右键单击工具栏中的空白处,然后从上下文菜单中选择“自定义菜单和工具栏”。
    【解决方案3】:

    如果您使用“绿色箭头”(运行应用程序),则不会触发应用更改。由于“应用更改”不会更改生成的 APK,因此“禁用”它毫无意义。

    • 如果您单击运行应用程序,则会生成、安装并运行正常的 APK。不调用 Instant Run。
    • 如果您点击“Apply Changes”或“Apply Code Changes”,则会生成并安装一个普通的 APK,然后通过类交换触发 Apply Changes。

    【讨论】:

      【解决方案4】:

      它就在这里,但您需要 API 8 或更高版本的虚拟设备或智能手机...

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2018-12-19
        • 2017-11-11
        • 2020-02-02
        • 1970-01-01
        • 2017-07-20
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多