毕业:java.lang.NoClassDefFoundError
Posted
技术标签:
【中文标题】毕业:java.lang.NoClassDefFoundError【英文标题】:gradle : java.lang.NoClassDefFoundError 【发布时间】:2022-01-06 12:40:50 【问题描述】:我正在尝试使用 Room 数据库构建项目,但出现错误:
Caused by: java.lang.NoClassDefFoundError: androidx/room/compiler/processing/XProcessingStep
at androidx.room.RoomProcessor.initSteps(RoomProcessor.kt:43)
at com.google.auto.common.BasicAnnotationProcessor.init(BasicAnnotationProcessor.java:118)
at org.jetbrains.kotlin.kapt3.base.incremental.IncrementalProcessor.init(incrementalProcessors.kt:38)
at org.jetbrains.kotlin.kapt3.base.ProcessorWrapper.init(annotationProcessing.kt:156)
at com.sun.tools.javac.processing.JavacProcessingEnvironment$ProcessorState.<init>(JavacProcessingEnvironment.java:500)
at com.sun.tools.javac.processing.JavacProcessingEnvironment$DiscoveredProcessors$ProcessorStateIterator.next(JavacProcessingEnvironment.java:597)
at com.sun.tools.javac.processing.JavacProcessingEnvironment.discoverAndRunProcs(JavacProcessingEnvironment.java:690)
at com.sun.tools.javac.processing.JavacProcessingEnvironment.access$1800(JavacProcessingEnvironment.java:91)
at com.sun.tools.javac.processing.JavacProcessingEnvironment$Round.run(JavacProcessingEnvironment.java:1035)
at com.sun.tools.javac.processing.JavacProcessingEnvironment.doProcessing(JavacProcessingEnvironment.java:1176)
at com.sun.tools.javac.main.JavaCompiler.processAnnotations(JavaCompiler.java:1170)
at com.sun.tools.javac.main.JavaCompiler.processAnnotations(JavaCompiler.java:1068)
at org.jetbrains.kotlin.kapt3.base.AnnotationProcessingKt.doAnnotationProcessing(annotationProcessing.kt:79)
... 27 more
Caused by: java.lang.ClassNotFoundException: androidx.room.compiler.processing.XProcessingStep
... 40 more
有什么想法吗?
问候
【问题讨论】:
【参考方案1】:如果您使用多模块,请将房间从 2.3.0 升级到 2.4.0-beta02。它应该可以解决问题
【讨论】:
您的答案可以通过额外的支持信息得到改进。请edit 添加更多详细信息,例如引用或文档,以便其他人可以确认您的答案是正确的。你可以找到更多关于如何写好答案的信息in the help center。以上是关于毕业:java.lang.NoClassDefFoundError的主要内容,如果未能解决你的问题,请参考以下文章
windows10下使用spark-2.3.0-bin-without-hadoop相关问题