繁体   English   中英

Android Studio 2.0-此版本的Android Studio与所使用的Gradle插件不兼容。 尝试禁用即时运行

[英]Android Studio 2.0 - this version of Android Studio is incompatible with the Gradle Plugin used. Try disabling Instant Run

我更新了Android Studio 2.0预览版6并正常使用了很长时间。但是,当我今天创建一个新项目时,它显示错误插件太旧,请更新至最新版本,或将ANDROID_DAILY_OVERRIDE环境变量设置为

我在链接中查找解决方案: Android Studio 2.0-插件太旧,请更新至最新版本,或将ANDROID_DAILY_OVERRIDE环境变量设置为更改了build.gradle(Project)类路径和gradle-wrapper.properties ,但是现在项目可以正常构建但无法运行,显示的错误是“ 此版本的Android Studio与所用的Gradle插件不兼容。请尝试禁用即时运行。无法找到相同的任何解决方案。 我是一个初学者,任何帮助将不胜感激。

我的app / build.gradle

apply plugin: 'com.android.application'

android {
    compileSdkVersion 'Google Inc.:Google APIs:23'
    buildToolsVersion "23.0.2"

    defaultConfig {
        applicationId "com.example.timercheck"
        minSdkVersion 15
        targetSdkVersion 23
        versionCode 1
        versionName "1.0"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    testCompile 'junit:junit:4.12'
    compile 'com.android.support:appcompat-v7:23.+'
    compile 'com.android.support:design:23.+'
}

我的build.gradle(项目)

    // Top-level build file where you can add configuration options common to all sub-projects/modules.

    buildscript {
        repositories {
            jcenter()
        }
        dependencies {
            classpath 'com.android.tools.build:gradle:2.0.0-beta6'

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

    allprojects {
        repositories {
            jcenter()
        }
    }

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

在此处输入图片说明

  1. 在设置中,搜索“ Instant Run然后清除“ Enable instant run对热插拔代码的Enable instant run
  2. 清洁项目

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM