gradle.properties kapt.incremental.apt=true breaks build

拟墨画扇 提交于 2019-12-08 02:49:39

问题


guys anybody had issus with incremental apt? I turn it on via kapt.incremental.apt=true

but then gradle breaks with

* What went wrong:
Execution failed for task ':core:kaptDebugKotlin'.
> Could not resolve all files for configuration ':core:_classStructurekaptDebugKotlin'.
   > Failed to transform file 'classes.jar' to match attributes {artifactType=class-structure, org.gradle.usage=java-runtime-jars}
      > Execution failed for StructureArtifactTransform: C:\Users\ursus\.gradle\caches\transforms-2\files-2.1\d17b7c88a03f1112fe0ba327a2d0eee6\jars\classes.jar.
         > java.lang.IllegalArgumentException (no error message)
   > Failed to transform file 'runtime-jvm-1.1.3.jar' to match attributes {artifactType=class-structure, org.gradle.usage=java-runtime-jars}
      > Execution failed for StructureArtifactTransform: C:\Users\ursus\.gradle\caches\modules-2\files-2.1\com.squareup.sqldelight\runtime-jvm\1.1.3\133500e0dcd9092c8f376d5add6ad7c4afb7177e\runtime-jvm-1.1.3.jar.
         > java.lang.IllegalArgumentException (no error message)
   > Failed to transform file 'kotlin-stdlib-jdk7-1.3.40.jar' to match attributes {artifactType=class-structure, org.gradle.usage=java-runtime-jars}
      > Execution failed for StructureArtifactTransform: C:\Users\ursus\.gradle\caches\modules-2\files-2.1\org.jetbrains.kotlin\kotlin-stdlib-jdk7\1.3.40\2995de8f68444ad47f29e7b59962ac31e6301d7e\kotlin-stdlib-jdk7-1.3.40.jar.
         > java.lang.IllegalArgumentException (no error message)

.... truncated, same error but different dependency

running with --stacktrace gives more of the same, only this looks promising

Caused by: java.lang.IllegalArgumentException
        at org.jetbrains.org.objectweb.asm.ClassVisitor.<init>(ClassVisitor.java:79)
        at org.jetbrains.kotlin.gradle.internal.kapt.incremental.ClassAbiExtractor.<init>(ClassAbiExtractor.kt:12)
        at org.jetbrains.kotlin.gradle.internal.kapt.incremental.ClasspathAnalyzerKt.analyzeInputStream(ClasspathAnalyzer.kt:70)
        at org.jetbrains.kotlin.gradle.internal.kapt.incremental.ClasspathAnalyzerKt.visitJar(ClasspathAnalyzer.kt:61)
        at org.jetbrains.kotlin.gradle.internal.kapt.incremental.ClasspathAnalyzerKt.access$visitJar(ClasspathAnalyzer.kt:1)
        at org.jetbrains.kotlin.gradle.internal.kapt.incremental.StructureArtifactTransform.transform(ClasspathAnalyzer.kt:23)
        at org.gradle.api.internal.artifacts.transform.LegacyTransformer.transform(LegacyTransformer.java:76)
        at org.gradle.api.internal.artifacts.transform.DefaultTransformerInvoker$TransformerExecution.execute(DefaultTransformerInvoker.java:274)
        at org.gradle.internal.execution.steps.ExecuteStep.lambda$execute$1(ExecuteStep.java:33)
        at org.gradle.internal.execution.steps.ExecuteStep.execute(ExecuteStep.java:33)
        at org.gradle.internal.execution.steps.ExecuteStep.execute(ExecuteStep.java:26)
        at org.gradle.internal.execution.steps.CleanupOutputsStep.execute(CleanupOutputsStep.java:58)
        at org.gradle.internal.execution.steps.CleanupOutputsStep.execute(CleanupOutputsStep.java:35)
        at org.gradle.internal.execution.steps.ResolveInputChangesStep.execute(ResolveInputChangesStep.java:48)
        at org.gradle.internal.execution.steps.ResolveInputChangesStep.execute(ResolveInputChangesStep.java:33)
        at org.gradle.internal.execution.steps.CancelExecutionStep.execute(CancelExecutionStep.java:39)
        at org.gradle.internal.execution.steps.TimeoutStep.executeWithoutTimeout(TimeoutStep.java:73)
        at org.gradle.internal.execution.steps.TimeoutStep.execute(TimeoutStep.java:54)
        at org.gradle.internal.execution.steps.CatchExceptionStep.execute(CatchExceptionStep.java:35)
        at org.gradle.internal.execution.steps.CreateOutputsStep.execute(CreateOutputsStep.java:51)
        at org.gradle.internal.execution.steps.SnapshotOutputsStep.execute(SnapshotOutputsStep.java:45)
        at org.gradle.internal.execution.steps.SnapshotOutputsStep.execute(SnapshotOutputsStep.java:31)
        at org.gradle.internal.execution.steps.CacheStep.executeWithoutCache(CacheStep.java:201)
        at org.gradle.internal.execution.steps.CacheStep.execute(CacheStep.java:70)
        at org.gradle.internal.execution.steps.CacheStep.execute(CacheStep.java:45)
        at org.gradle.internal.execution.steps.BroadcastChangingOutputsStep.execute(BroadcastChangingOutputsStep.java:49)
        at org.gradle.internal.execution.steps.StoreSnapshotsStep.execute(StoreSnapshotsStep.java:43)
        at org.gradle.internal.execution.steps.StoreSnapshotsStep.execute(StoreSnapshotsStep.java:32)
        at org.gradle.internal.execution.steps.RecordOutputsStep.execute(RecordOutputsStep.java:38)
        at org.gradle.internal.execution.steps.RecordOutputsStep.execute(RecordOutputsStep.java:24)
        at org.gradle.internal.execution.steps.SkipUpToDateStep.executeBecause(SkipUpToDateStep.java:96)
        at org.gradle.internal.execution.steps.SkipUpToDateStep.lambda$execute$0(SkipUpToDateStep.java:89)
        at org.gradle.internal.execution.steps.SkipUpToDateStep.execute(SkipUpToDateStep.java:54)
        at org.gradle.internal.execution.steps.SkipUpToDateStep.execute(SkipUpToDateStep.java:38)
        at org.gradle.internal.execution.steps.ResolveChangesStep.execute(ResolveChangesStep.java:77)
        at org.gradle.internal.execution.steps.ResolveChangesStep.execute(ResolveChangesStep.java:37)
        at org.gradle.internal.execution.steps.legacy.MarkSnapshottingInputsFinishedStep.execute(MarkSnapshottingInputsFinishedStep.java:36)
        at org.gradle.internal.execution.steps.legacy.MarkSnapshottingInputsFinishedStep.execute(MarkSnapshottingInputsFinishedStep.java:26)
        at org.gradle.internal.execution.steps.ResolveCachingStateStep.execute(ResolveCachingStateStep.java:90)
        at org.gradle.internal.execution.steps.ResolveCachingStateStep.execute(ResolveCachingStateStep.java:48)
        at org.gradle.internal.execution.impl.DefaultWorkExecutor.execute(DefaultWorkExecutor.java:33)
        at org.gradle.api.internal.artifacts.transform.DefaultTransformerInvoker.lambda$invoke$2(DefaultTransformerInvoker.java:148)
        ... 39 more

org.gradle.jvmargs=-Xmx1536m
org.gradle.parallel=true
kotlin.code.style=official
kotlin.parallel.tasks.in.project=true
kapt.include.compile.classpath=false
kapt.incremental.apt=true <----
kapt.use.worker.api=true
android.useAndroidX=true
android.enableJetifier=true

gradle 5.1.1; agp 3.4.1, kotlin 1.3.40

来源:https://stackoverflow.com/questions/56765491/gradle-properties-kapt-incremental-apt-true-breaks-build

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!