question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Build error with Android Gradle plugin 2.4.0-alpha3

See original GitHub issue

Any clues about why is this?

Error:Bad service configuration file, or exception thrown while constructing Processor object: javax.annotation.processing.Processor: Provider com.evernote.android.state.StateProcessor could not be instantiated: java.lang.NoClassDefFoundError: com/evernote/android/state/State
* Exception is:
org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':app:compileDevDebugJavaWithJavac'.
	at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:84)
	at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:55)
	at org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter.execute(SkipUpToDateTaskExecuter.java:62)
	at org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execute(ValidatingTaskExecuter.java:58)
	at org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecuter.execute(SkipEmptySourceFilesTaskExecuter.java:88)
	at org.gradle.api.internal.tasks.execution.ResolveTaskArtifactStateTaskExecuter.execute(ResolveTaskArtifactStateTaskExecuter.java:46)
	at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:51)
	at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:54)
	at org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter.execute(ExecuteAtMostOnceTaskExecuter.java:43)
	at org.gradle.api.internal.tasks.execution.CatchExceptionTaskExecuter.execute(CatchExceptionTaskExecuter.java:34)
	at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker$1.execute(DefaultTaskGraphExecuter.java:236)
	at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker$1.execute(DefaultTaskGraphExecuter.java:228)
	at org.gradle.internal.Transformers$4.transform(Transformers.java:169)
	at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:106)
	at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:61)
	at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:228)
	at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:215)
	at org.gradle.execution.taskgraph.AbstractTaskPlanExecutor$TaskExecutorWorker.processTask(AbstractTaskPlanExecutor.java:77)
	at org.gradle.execution.taskgraph.AbstractTaskPlanExecutor$TaskExecutorWorker.run(AbstractTaskPlanExecutor.java:58)
	at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:54)
	at org.gradle.internal.concurrent.StoppableExecutorImpl$1.run(StoppableExecutorImpl.java:40)
Caused by: org.gradle.api.internal.tasks.compile.CompilationFailedException: Compilation failed; see the compiler error output for details.
	at org.gradle.api.internal.tasks.compile.JdkJavaCompiler.execute(JdkJavaCompiler.java:48)
	at org.gradle.api.internal.tasks.compile.JdkJavaCompiler.execute(JdkJavaCompiler.java:33)
	at org.gradle.api.internal.tasks.compile.NormalizingJavaCompiler.delegateAndHandleErrors(NormalizingJavaCompiler.java:104)
	at org.gradle.api.internal.tasks.compile.NormalizingJavaCompiler.execute(NormalizingJavaCompiler.java:53)
	at org.gradle.api.internal.tasks.compile.NormalizingJavaCompiler.execute(NormalizingJavaCompiler.java:38)
	at org.gradle.api.internal.tasks.compile.CleaningJavaCompilerSupport.execute(CleaningJavaCompilerSupport.java:35)
	at org.gradle.api.internal.tasks.compile.CleaningJavaCompilerSupport.execute(CleaningJavaCompilerSupport.java:25)
	at org.gradle.api.tasks.compile.JavaCompile.performCompilation(JavaCompile.java:206)
	at org.gradle.api.tasks.compile.JavaCompile.compile(JavaCompile.java:187)
	at org.gradle.api.tasks.compile.JavaCompile.compile(JavaCompile.java:130)
	at com.android.build.gradle.tasks.factory.AndroidJavaCompile.compile(AndroidJavaCompile.java:49)
	at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:73)
	at org.gradle.api.internal.project.taskfactory.DefaultTaskClassInfoStore$IncrementalTaskAction.doExecute(DefaultTaskClassInfoStore.java:163)
	at org.gradle.api.internal.project.taskfactory.DefaultTaskClassInfoStore$StandardTaskAction.execute(DefaultTaskClassInfoStore.java:134)
	at org.gradle.api.internal.project.taskfactory.DefaultTaskClassInfoStore$StandardTaskAction.execute(DefaultTaskClassInfoStore.java:123)
	at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeAction(ExecuteActionsTaskExecuter.java:95)
	at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:76)
	... 20 more

I am on Android Studio 2.4 Preview 2 Build #AI-171.3804685, built on March 15, 2017 JRE: 1.8.0_112-release-b736 x86_64 JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o

My build.gradle

buildscript {
    repositories {
        maven { url 'https://maven.fabric.io/public' }
        jcenter()
        maven { url 'https://jitpack.io' }
        maven {
            url "https://clojars.org/repo/"
        }
    }

    dependencies {
        classpath 'io.fabric.tools:gradle:1.+'
        classpath 'me.tatarka:gradle-retrolambda:3.6.0'

    }
}


apply plugin: 'com.android.application'
apply plugin: 'me.tatarka.retrolambda'
apply plugin: 'io.fabric'
//apply plugin: 'com.f2prateek.javafmt'



android {
    compileSdkVersion 25
    buildToolsVersion '25.0.2'

    defaultConfig {
        applicationId "site.paid2party.android"
        minSdkVersion 16
        targetSdkVersion 25
        versionCode 1
        versionName "1.0"
        multiDexEnabled true
    }
    buildTypes {
        debug {
            applicationIdSuffix '.debug'
            versionNameSuffix '-DEBUG'
            ext.enableCrashlytics = true
            testCoverageEnabled = false
            debug {
                debuggable true
            }
        }
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
            debug {
                debuggable true
            }
        }
        buildTypes.each {
            it.buildConfigField 'String', 'TEST_KEY', TEST_KEY
        }
    }
    dexOptions {
        javaMaxHeapSize "2048M"
        preDexLibraries = false
    }
    productFlavors {
        // When building a variant that uses this flavor, the following configurations
        // override those in the defaultConfig block.
        dev {
            // To avoid using legacy multidex, set minSdkVersion to 21 or higher.
            minSdkVersion 21
            versionNameSuffix "-dev"
            applicationIdSuffix '.dev'
            resConfigs "en", "xxhdpi"
        }

        prod {
            // If you've configured the defaultConfig block for the release version of
            // your app, you can leave this block empty and Gradle uses configurations in
            // the defaultConfig block instead. You still need to create this flavor.
            // Otherwise, all variants use the "dev" flavor configurations.
        }
    }
    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }
}

repositories {
    mavenCentral()
    maven { url 'https://jitpack.io' }
    maven { url 'https://maven.fabric.io/public' }

}

// Define versions in a single place
ext {


    // App dependencies
    supportLibraryVersion = '25.2.0'
    playServicesVersion = '10.2.0'

}
//https://developer.android.com/topic/libraries/support-library/packages.html
dependencies {
    compile fileTree(include: ['*.jar'], dir: 'libs')
    compile "com.android.support:appcompat-v7:${supportLibraryVersion}"
    compile "com.android.support:cardview-v7:${supportLibraryVersion}"
    compile "com.android.support:design:${supportLibraryVersion}"
    compile "com.android.support:support-v4:${supportLibraryVersion}"
    compile "com.android.support:recyclerview-v7:${supportLibraryVersion}"
    compile "com.android.support:palette-v7:${supportLibraryVersion}"
    compile "com.android.support:gridlayout-v7:${supportLibraryVersion}"

    compile "com.google.android.gms:play-services-identity:$playServicesVersion"
    compile "com.google.android.gms:play-services:$playServicesVersion"
    compile "com.google.android.gms:play-services-places:$playServicesVersion"
    compile "com.google.android.gms:play-services-location:$playServicesVersion"

    compile('com.crashlytics.sdk.android:crashlytics:2.6.7@aar') {
        transitive = true;
    }

    compile 'com.evernote:android-state:1.0.5'
    annotationProcessor 'com.evernote:android-state-processor:1.0.5'

    debugCompile 'com.squareup.leakcanary:leakcanary-android:1.5'
    releaseCompile 'com.squareup.leakcanary:leakcanary-android-no-op:1.5'
    testCompile 'com.squareup.leakcanary:leakcanary-android-no-op:1.5'


}

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:14

github_iconTop GitHub Comments

2reactions
vRallevcommented, May 13, 2017

I finally figured out what’s wrong and now bundle the library classes in the annotation processor jar. This will be fixed in the next version. If you want, you can give the snapshot build a try:

repositories {
    jcenter()

    maven {
        url 'https://oss.sonatype.org/content/repositories/snapshots/'
    }
}

dependencies {
    compile 'com.evernote:android-state:1.1.0-SNAPSHOT'
    kapt 'com.evernote:android-state-processor:1.1.0-SNAPSHOT'
}
1reaction
vRallevcommented, Apr 7, 2017

Update: The workaround in the ticket works for me:

android {
    defaultConfig {
        javaCompileOptions {
            annotationProcessorOptions {
                includeCompileClasspath true
            }
        }
    }
}

However, plugin alpha4 has another problem.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Android Studio 2.3 / 2.4 fails with android gradle plugin 2.4.0-alpha3 ...
execTransact(Binder.java:565)) Error while Installing APK. After changing the project gradle from classpath 'com.android.tools.build:gradle:2.4.0-alpha3'.
Read more >
Known issues with Android Studio and Android Gradle Plugin
This page tracks known issues with Android Studio Dolphin | 2021.3.1 and Android Gradle plugin 7.3.1. If you experience an issue not already...
Read more >
ResourceException (Gradle Plugin for Android) - javadoc.io
Package: com.android.build.gradle.tasks ... Exception used for resource merging errors, thrown when a MergingException is thrown by the resource merging ...
Read more >
Upgrading your build from Gradle 4.x to 5.0
If you are using Gradle for Android, you need to move to version 3.3 or higher of both the Android Gradle Plugin and...
Read more >
Maven Central Repository Search
Official search by the maintainers of Maven Central Repository.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found