Execution failed for task \"app:transformClassesWi

2019-05-01 08:08发布

问题:

Hi guys I hope you can help me,

If I want to run my Application, I get this error.

Error:Execution failed for task ':app:transformClassesWithInstantRunForDebug'. java.lang.NullPointerException (no error message)

My Gradle looks like this

pply plugin: 'com.android.application'

android {
    compileSdkVersion 24
    buildToolsVersion "24.0.0"

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

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

回答1:

This happened with me when I tried to upgrade gradle plugin version in my project-level. It was

classpath 'com.android.tools.build:gradle:2.1.3'

And then I upgraded it to 2.2-beta, then I got the same error you are getting.

Setting it back to '2.1.3' fixed it for me