Gradle - Transformation hasn't been executed yet
Asked Answered
K

4

9

I just migrated my project to androidx and enabled jetifier.

Now when I want to build my project I get this error : " Transformation hasn't been executed yet " Gradle sync finishes without any error but building fails.

This task is failed to execute :

Transform org.eclipse.jdt.core.jar (org.eclipse.jdt:org.eclipse.jdt.core:3.10.0) with IdentityTransform

StackTrace :

java.lang.IllegalStateException: Transformation hasn't been executed yet
    at org.gradle.api.internal.artifacts.transform.TransformInfo.getFailure(TransformInfo.java:88)
    at org.gradle.api.internal.artifacts.transform.TransformInfo.access$300(TransformInfo.java:48)
    at org.gradle.api.internal.artifacts.transform.TransformInfo$ChainedTransformInfo$ChainedArtifactTransformStepOperation.run(TransformInfo.java:235)
    at org.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:300)
    at org.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:292)
    at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:174)
    at org.gradle.internal.operations.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:90)
    at org.gradle.internal.operations.DelegatingBuildOperationExecutor.run(DelegatingBuildOperationExecutor.java:31)
    at org.gradle.api.internal.artifacts.transform.TransformInfo$ChainedTransformInfo.execute(TransformInfo.java:217)
    at org.gradle.api.internal.artifacts.transform.TransformInfoExecutor.execute(TransformInfoExecutor.java:34)
    at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$BuildOperationAwareWorkItemExecutor.execute(DefaultTaskExecutionGraph.java:277)
    at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$BuildOperationAwareWorkItemExecutor.execute(DefaultTaskExecutionGraph.java:262)
    at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$ExecutorWorker$1.execute(DefaultTaskPlanExecutor.java:135)
    at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$ExecutorWorker$1.execute(DefaultTaskPlanExecutor.java:130)
    at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$ExecutorWorker.execute(DefaultTaskPlanExecutor.java:200)
    at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$ExecutorWorker.executeWithWork(DefaultTaskPlanExecutor.java:191)
    at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$ExecutorWorker.run(DefaultTaskPlanExecutor.java:130)
    at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:63)
    at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:46)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:55)
    at java.lang.Thread.run(Thread.java:745)

My workstation :

Build: 3.3 Canary 13
Android Gradle Plugin: 3.3.0-alpha13
Gradle: 4.10.1
BuildToolsVersion : 28.0.3
Compile/Targer sdkVersion : 28
Kerekes answered 16/10, 2018 at 17:15 Comment(0)
K
2

This issue was related to AutoFactory library that causing the build to fail.

After digging the internet a little bit I found that replacing

com.google.auto.factory:auto-factory:1.0-beta5

with

com.google.auto.factory:auto-factory:1.0-beta5@jar

in the dependencies fixes the problem.

Kerekes answered 18/10, 2018 at 8:3 Comment(2)
How were you able to figure out that the issue was due to auto factory library?Danyelldanyelle
@TomTaylor searched the internet and end up in auto factory github repository issues. someone had the same issue, I tested it and it worked. Before that I removed the library from my project and the build got complete so it had something to do with AF.Kerekes
I
7

Update your wrapper to the latest version in gradle-wrapper.properties.

Mine was

distributionUrl==https\://services.gradle.org/distributions/gradle-4.10.1-all.zip

and I updated to

distributionUrl=https\://services.gradle.org/distributions/gradle-5.2.1-all.zip

Illene answered 28/2, 2019 at 5:2 Comment(0)
M
3

Ok Guys!

I found the error. It was mine. I was trying to implement the library instead of testImplement it. I was having the error above thrown by the jetifier tasks. So I just changed it from:

implementation "com.android.tools.lint:lint-api:26.2.1"

implementation "com.android.tools.lint:lint-tests:26.2.1"

to

testImplementation "com.android.tools.lint:lint-api:26.2.1"

testImplementation "com.android.tools.lint:lint-tests:26.2.1"

Thanks Jesus! And there were 2 days...

Monotonous answered 10/12, 2018 at 19:7 Comment(1)
Please fully explain your answer. What additional information are you providing that is not covered in the accepted answer?Carnot
K
2

This issue was related to AutoFactory library that causing the build to fail.

After digging the internet a little bit I found that replacing

com.google.auto.factory:auto-factory:1.0-beta5

with

com.google.auto.factory:auto-factory:1.0-beta5@jar

in the dependencies fixes the problem.

Kerekes answered 18/10, 2018 at 8:3 Comment(2)
How were you able to figure out that the issue was due to auto factory library?Danyelldanyelle
@TomTaylor searched the internet and end up in auto factory github repository issues. someone had the same issue, I tested it and it worked. Before that I removed the library from my project and the build got complete so it had something to do with AF.Kerekes
S
0

I started getting this error without any changes, just like that.

Nothing helped but this worked for me: Deleting the existing repo, cloning it again, remove project from Android Studio and open the existing project with just cloned repo. Works fine now.

Sumptuary answered 29/1, 2020 at 11:56 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.