Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error building with Android Studio 3.1 #42

Closed
leesah opened this issue Mar 31, 2018 · 10 comments
Closed

Error building with Android Studio 3.1 #42

leesah opened this issue Mar 31, 2018 · 10 comments

Comments

@leesah
Copy link

leesah commented Mar 31, 2018

After upgrading to Android Studio 3.1, I got error groovy-all is loaded in version 2.4.4 and you are trying to load version 2.4.12 when building.

Project-level build.gradle

buildscript {
    dependencies {
        //noinspection GradleDependency
        classpath 'org.jacoco:org.jacoco.core:0.7.9'
        classpath 'com.dicedmelon.gradle:jacoco-android:0.1.2'
    }
}

Module-level build.gradle

apply plugin: 'com.android.application'
apply plugin: 'jacoco-android'

jacoco {
    toolVersion = "0.7.9"
}

jacocoAndroidUnitTestReport {
    csv.enabled false
    html.enabled false
    xml.enabled true
}

Workaround

I added classpath 'org.codehaus.groovy:groovy-all:2.4.12' to project-level build.gradle and the error was gone.

buildscript {
    dependencies {
        //noinspection GradleDependency
        classpath 'org.jacoco:org.jacoco.core:0.7.9'
        classpath 'org.codehaus.groovy:groovy-all:2.4.12'
        classpath 'com.dicedmelon.gradle:jacoco-android:0.1.2'
    }
}

Stacktrace

$ ./gradlew assembleDebug --stacktrace

> Configure project :app 
WARNING: The option 'android.enableAapt2' is deprecated and should not be used anymore.
Use 'android.enableAapt2=true' to remove this warning.
It will be removed at the end of 2018.
WARNING: Configuration 'compile' is obsolete and has been replaced with 'implementation'.
It will be removed at the end of 2018
registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection)
registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection)
registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection)
registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection)

> Task :app:processDebugGoogleServices 
Parsing json file: /home/esaalii/Workspace/Nevermind/app/google-services.json

> Task :app:compileDebugJavaWithJavac 
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.

D8: Stripped invalid locals information from 2 methods.

BUILD SUCCESSFUL in 34s
32 actionable tasks: 32 executed
esaalii@elxabbmqmc2:~/Workspace/Nevermind (master)$ ./gradlew assembleDebug --stacktrace

> Configure project :app 
WARNING: The option 'android.enableAapt2' is deprecated and should not be used anymore.
Use 'android.enableAapt2=true' to remove this warning.
It will be removed at the end of 2018.
WARNING: Configuration 'compile' is obsolete and has been replaced with 'implementation'.
It will be removed at the end of 2018
registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection)
registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection)
registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection)
registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection)

> Task :app:processDebugGoogleServices 
Parsing json file: /home/esaalii/Workspace/Nevermind/app/google-services.json

> Task :app:compileDebugJavaWithJavac 
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.


FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:transformClassesWithJacocoForDebug'.
> There were multiple failures while executing work items
   > java.util.concurrent.ExecutionException: org.gradle.workers.internal.DefaultWorkerExecutor$WorkExecutionException: A failure occurred while executing com.android.build.gradle.internal.transforms.JacocoTransform$JacocoWorkerAction
   > java.util.concurrent.ExecutionException: org.gradle.workers.internal.DefaultWorkerExecutor$WorkExecutionException: A failure occurred while executing com.android.build.gradle.internal.transforms.JacocoTransform$JacocoWorkerAction

* Try:
Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Exception is:
org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':app:transformClassesWithJacocoForDebug'.
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:100)
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:70)
        at org.gradle.api.internal.tasks.execution.OutputDirectoryCreatingTaskExecuter.execute(OutputDirectoryCreatingTaskExecuter.java:51)
        at org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter.execute(SkipUpToDateTaskExecuter.java:62)
        at org.gradle.api.internal.tasks.execution.ResolveTaskOutputCachingStateExecuter.execute(ResolveTaskOutputCachingStateExecuter.java:54)
        at org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execute(ValidatingTaskExecuter.java:60)
        at org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecuter.execute(SkipEmptySourceFilesTaskExecuter.java:97)
        at org.gradle.api.internal.tasks.execution.CleanupStaleOutputsExecuter.execute(CleanupStaleOutputsExecuter.java:87)
        at org.gradle.api.internal.tasks.execution.ResolveTaskArtifactStateTaskExecuter.execute(ResolveTaskArtifactStateTaskExecuter.java:52)
        at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:52)
        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.run(DefaultTaskGraphExecuter.java:248)
        at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:336)
        at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:328)
        at org.gradle.internal.progress.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:199)
        at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:110)
        at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:241)
        at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:230)
        at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker.processTask(DefaultTaskPlanExecutor.java:123)
        at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker.access$200(DefaultTaskPlanExecutor.java:79)
        at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker$1.execute(DefaultTaskPlanExecutor.java:104)
        at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker$1.execute(DefaultTaskPlanExecutor.java:98)
        at org.gradle.execution.taskgraph.DefaultTaskExecutionPlan.execute(DefaultTaskExecutionPlan.java:626)
        at org.gradle.execution.taskgraph.DefaultTaskExecutionPlan.executeWithTask(DefaultTaskExecutionPlan.java:581)
        at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker.run(DefaultTaskPlanExecutor.java:98)
        at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:63)
        at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:46)
        at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:55)
Caused by: org.gradle.workers.WorkerExecutionException: There were multiple failures while executing work items
        at org.gradle.workers.internal.DefaultWorkerExecutor.workerExecutionException(DefaultWorkerExecutor.java:173)
        at org.gradle.workers.internal.DefaultWorkerExecutor.await(DefaultWorkerExecutor.java:165)
        at com.android.build.gradle.internal.transforms.JacocoTransform.transform(JacocoTransform.java:145)
        at com.android.build.gradle.internal.pipeline.TransformTask$2.call(TransformTask.java:221)
        at com.android.build.gradle.internal.pipeline.TransformTask$2.call(TransformTask.java:217)
        at com.android.builder.profile.ThreadRecorder.record(ThreadRecorder.java:102)
        at com.android.build.gradle.internal.pipeline.TransformTask.transform(TransformTask.java:212)
        at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:73)
        at org.gradle.api.internal.project.taskfactory.IncrementalTaskAction.doExecute(IncrementalTaskAction.java:46)
        at org.gradle.api.internal.project.taskfactory.StandardTaskAction.execute(StandardTaskAction.java:39)
        at org.gradle.api.internal.project.taskfactory.StandardTaskAction.execute(StandardTaskAction.java:26)
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter$1.run(ExecuteActionsTaskExecuter.java:121)
        at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:336)
        at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:328)
        at org.gradle.internal.progress.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:199)
        at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:110)
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeAction(ExecuteActionsTaskExecuter.java:110)
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:92)
        ... 29 more
Caused by: org.gradle.internal.UncheckedException: java.util.concurrent.ExecutionException: org.gradle.workers.internal.DefaultWorkerExecutor$WorkExecutionException: A failure occurred while executing com.android.build.gradle.internal.transforms.JacocoTransform$JacocoWorkerAction
        at org.gradle.internal.UncheckedException.throwAsUncheckedException(UncheckedException.java:63)
        at org.gradle.internal.UncheckedException.throwAsUncheckedException(UncheckedException.java:40)
        at org.gradle.workers.internal.DefaultWorkerExecutor$2.waitForCompletion(DefaultWorkerExecutor.java:148)
        at org.gradle.internal.work.DefaultAsyncWorkTracker.waitForItemsAndGatherFailures(DefaultAsyncWorkTracker.java:99)
        at org.gradle.internal.work.DefaultAsyncWorkTracker.waitForCompletion(DefaultAsyncWorkTracker.java:87)
        at org.gradle.workers.internal.DefaultWorkerExecutor.await(DefaultWorkerExecutor.java:163)
        ... 45 more
Caused by: java.util.concurrent.ExecutionException: org.gradle.workers.internal.DefaultWorkerExecutor$WorkExecutionException: A failure occurred while executing com.android.build.gradle.internal.transforms.JacocoTransform$JacocoWorkerAction
        at org.gradle.workers.internal.DefaultWorkerExecutor$2.waitForCompletion(DefaultWorkerExecutor.java:141)
        ... 48 more
Caused by: org.gradle.workers.internal.DefaultWorkerExecutor$WorkExecutionException: A failure occurred while executing com.android.build.gradle.internal.transforms.JacocoTransform$JacocoWorkerAction
        at org.gradle.workers.internal.DefaultWorkerExecutor$1.call(DefaultWorkerExecutor.java:107)
        at org.gradle.workers.internal.DefaultWorkerExecutor$1.call(DefaultWorkerExecutor.java:99)
        ... 3 more
Caused by: java.lang.ExceptionInInitializerError
        at org.gradle.api.internal.classloading.GroovySystemLoaderFactory.forClassLoader(GroovySystemLoaderFactory.java:44)
        at org.gradle.workers.internal.IsolatedClassloaderWorkerFactory.executeInWorkerClassLoader(IsolatedClassloaderWorkerFactory.java:106)
        at org.gradle.workers.internal.IsolatedClassloaderWorkerFactory.access$200(IsolatedClassloaderWorkerFactory.java:56)
        at org.gradle.workers.internal.IsolatedClassloaderWorkerFactory$1$1.call(IsolatedClassloaderWorkerFactory.java:84)
        at org.gradle.workers.internal.IsolatedClassloaderWorkerFactory$1$1.call(IsolatedClassloaderWorkerFactory.java:81)
        at org.gradle.internal.progress.DefaultBuildOperationExecutor$CallableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:350)
        at org.gradle.internal.progress.DefaultBuildOperationExecutor$CallableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:340)
        at org.gradle.internal.progress.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:199)
        at org.gradle.internal.progress.DefaultBuildOperationExecutor.call(DefaultBuildOperationExecutor.java:120)
        at org.gradle.workers.internal.IsolatedClassloaderWorkerFactory$1.execute(IsolatedClassloaderWorkerFactory.java:81)
        at org.gradle.workers.internal.DefaultWorkerExecutor$1.call(DefaultWorkerExecutor.java:105)
        ... 4 more
Caused by: groovy.lang.GroovyRuntimeException: Conflicting module versions. Module [groovy-all is loaded in version 2.4.4 and you are trying to load version 2.4.12
        ... 15 more


* Get more help at https://help.gradle.org

BUILD FAILED in 5s
22 actionable tasks: 22 executed
@Tapchicoma
Copy link

Another workaround:

classpath('com.dicedmelon.gradle:jacoco-android:0.1.2') {
    exclude group: 'org.codehaus.groovy', module: 'groovy-all'
}

@Tapchicoma
Copy link

Also this PR should fix this issue: #41

daniele-athome added a commit to kontalk/androidclient that referenced this issue Apr 8, 2018
arturdm/jacoco-android-gradle-plugin#42

Signed-off-by: Daniele Ricci <daniele@casaricci.it>
@friederbluemle
Copy link
Contributor

#41 is up-to-date and ready to merge.

mcomella added a commit to mcomella/firefox-tv that referenced this issue Apr 16, 2018
This seemed to cause a failure (local and CI) when the gradle plugin
version was bumped. It may be filed here:
arturdm/jacoco-android-gradle-plugin#42
mcomella added a commit to mozilla-mobile/firefox-tv that referenced this issue Apr 16, 2018
This seemed to cause a failure (local and CI) when the gradle plugin
version was bumped. It may be filed here:
arturdm/jacoco-android-gradle-plugin#42
@tobiasKaminsky
Copy link

tobiasKaminsky commented Nov 7, 2018

This is now happening again when using gradle-3.3.0-beta02 and gradle-4.10.1:

Caused by: groovy.lang.GroovyRuntimeException: Conflicting module versions. Module [groovy-all is loaded in version 2.4.12 and you are trying to load version 2.4.15

EDIT:
classpath('com.dicedmelon.gradle:jacoco-android:0.1.3'){ exclude group: 'org.codehaus.groovy', module: 'groovy-all' }

helps

@friederbluemle
Copy link
Contributor

@tobiasKaminsky I just opened #53 which should take care of that...

@Hesamedin
Copy link

Any update on #53? I have same issue.

@sumit-anantwar
Copy link

Still having this issue. Any update on this?

@xiaobailong24
Copy link

reference
magnusja/libaums#138

@pinpong
Copy link

pinpong commented Feb 24, 2019

Still having this issue. Any update on this?

    classpath("com.dicedmelon.gradle:jacoco-android:0.1.3") {
        exclude group: 'org.codehaus.groovy', module: 'groovy-all'
    }

@arturdm
Copy link
Owner

arturdm commented Feb 26, 2019

Fixed in 0.1.4 release.

@arturdm arturdm closed this as completed Feb 26, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants