JavacProcessingEnvironment

JavacProcessingEnvironment

我正在将一些我自己写到Room的注释处理器转换为一些Android db代码。我收到一个非常模糊的错误。经过一段时间后,通过分而治之,我将其范围缩小为两个运行固定查询的方法(即,它不带任何参数)。如以下内容:

@Query("update blah set mDownloadStatus=3, mTaskId=0 where mDownloadStatus=2 or mDownloadStatus >= 4")
    void resetDownloads();


运行./gradle --stacktrace assembleDebug之后,我得到了下面的stacktrace(上面有更多内容,但这是它的内容)。


  原因:java.util.NoSuchElementException:列表为空。
          在kotlin.collections.CollectionsKt ___ CollectionsKt.first(_Collections.kt:178)
          在android.arch.persistence.room.writer.DaoWriter.createPreparedDeleteOrUpdateQueries(DaoWriter.kt:124)
          在android.arch.persistence.room.writer.DaoWriter.createTypeSpecBuilder(DaoWriter.kt:86)
          在android.arch.persistence.room.writer.ClassWriter.write(ClassWriter.kt:40)
          在android.arch.persistence.room.RoomProcessor $ DatabaseProcessingStep.process(RoomProcessor.kt:60)
          在com.google.auto.common.BasicAnnotationProcessor.process(BasicAnnotationProcessor.java:318)
          在com.google.auto.common.BasicAnnotationProcessor.process(BasicAnnotationProcessor.java:171)
          在com.sun.tools.javac.processing.JavacProcessingEnvironment.callProcessor(JavacProcessingEnvironment.java:794)
          在com.sun.tools.javac.processing.JavacProcessingEnvironment.discoverAndRunProcs(JavacProcessingEnvironment.java:705)
          在com.sun.tools.javac.processing.JavacProcessingEnvironment.access处$ 1800(JavacProcessingEnvironment.java:91)
          在com.sun.tools.javac.processing.JavacProcessingEnvironment $ Round.run(JavacProcessingEnvironment.java:1035)
          在com.sun.tools.javac.processing.JavacProcessingEnvironment.doProcessing(JavacProcessingEnvironment.java:1176)
          在com.sun.tools.javac.main.JavaCompiler.processAnnotations(JavaCompiler.java:1170)
          在com.sun.tools.javac.main.JavaCompiler.compile(JavaCompiler.java:856)
          在com.sun.tools.javac.main.Main.compile(Main.java:523)
          ...更多126

最佳答案

这是。退回到直到此问题得到解决。