0

I try to use Room in Android Studio 3.0 with kotlin. I have successfully created 3 entities that work well (database is created, i can insert rows and so on). Now, i want to add some functionnalities but i have this enigmatic error:

Warning:warning: Supported source version 'RELEASE_7' from annotation processor 'android.arch.persistence.room.RoomProcessor' less than -source '1.8'

Error:Execution failed for task ':app:kaptDebugKotlin'.
   > Internal compiler error. See log for more details

Do you know how can I see "log for more details". Is there another way to point excatly where the error is ?

For the moment, I can find where the error is only by commenting one-by-one the portion of new codes i've added, until the compilation success.

By setting --stacktrace --debug for compiler option, the message is even more enigmatic:

Error:org.jetbrains.kotlin.kapt3.diagnostic.KaptError: Error while annotation processing

[Edit] It's not a duplicate : the linked question in Emmanuel S comment is a runtime exception. In my case, it's a compile time problem. And, I can correct the bug but the question I ask is about the lack of information about where is excactly the problem.

[Edit 2] I give some precision to my question by using an example. Imagine this code:

@Dao
PersonDao {
   @Query("SELECT * FROM categoryes")
   fun getAll() : List<Categ>
   ...
}

A compile error is fired but I understand why : it's because i've made a type in categoryes. But the error message give no idea where the problem is. After correcting the typo, all is good.

So, is there a way to know where the problem is exactly ? I think it's nothing to do with annotationProcessor or kapt in build.gradle

[Edit 3] Problem has been solved with Kotlin plugin update (from 1.1.51 to version new version 1.1.60)

Now i've a clear error message:

Error:(9, 1) error: There is a problem with the query: [SQLITE_ERROR] SQL error or missing database (no such table: categs)

So, was it really a duplicate ???

clear message with new version of Kotlin plugin

coutier eric
  • 949
  • 5
  • 18
  • there are really a few hundred answers about that topic. – Emanuel Oct 29 '17 at 18:54
  • @Emmanuel S : sorry but it's not a duplicate : the problem in the question you've linked is a runtime exception. In my case, it's a compile time problem. And, I can correct the bug but the problem is the lack of information – coutier eric Oct 29 '17 at 20:43
  • I didnt mean that its exactly the same issue, but the solution is always the same. add the proper depdencies, invalidate cache and restart, add kotlin kapt instead of annotationProcessors, ... – Emanuel Oct 29 '17 at 20:53
  • @Owen Pauling, MikeT, Nilesh Rathod, KeLiuyue, I'm very sorry but, re-read my post attentively, especially my second edit : my problem is not Exception during runtime but a lack of information during compilation. So why mark my question as a duplicate ? – coutier eric Oct 30 '17 at 11:31
  • post your dao, model and gradle. ill try to help. – Emanuel Oct 30 '17 at 11:32
  • Are there any error messages above the "Error while annotation processing" exception? Also, what Kotlin Gradle plugin version do you use? – yanex Nov 13 '17 at 04:22

0 Answers0