9

我刚刚将我的项目迁移到 androidx 并启用了 jetifier。

现在,当我想构建我的项目时,我收到此错误:“尚未执行转换” Gradle 同步完成且没有任何错误,但构建失败。

此任务执行失败:

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

堆栈跟踪 :

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)

我的工作站:

Build: 3.3 Canary 13
Android Gradle Plugin: 3.3.0-alpha13
Gradle: 4.10.1
BuildToolsVersion : 28.0.3
Compile/Targer sdkVersion : 28
4

4 回答 4

7

将您的包装器更新到最新版本gradle-wrapper.properties.

我的是

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

我更新为

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

于 2019-02-28T05:02:07.207 回答
3

好了朋友们!

我发现了错误。那是我的。我试图实现库而不是testImplement它。我遇到了 jetifier 任务引发的上述错误。所以我只是把它从:

实施“com.android.tools.lint:lint-api:26.2.1”

实施“com.android.tools.lint:lint-tests:26.2.1”

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

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

感谢耶稣!还有2天...

于 2018-12-10T19:07:28.297 回答
2

此问题与导致构建失败的 AutoFactory 库有关。

稍微挖掘一下互联网后,我发现替换

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

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

在依赖项中解决了这个问题。

于 2018-10-18T08:03:07.933 回答
0

我开始在没有任何更改的情况下收到此错误,就像那样。

没有任何帮助,但这对我有用:删除现有的 repo,再次克隆它,从 Android Studio 中删除项目,然后用刚刚克隆的 repo 打开现有项目。现在工作正常。

于 2020-01-29T11:56:39.120 回答