Home > Mobile >  How can I fix this error Android: org.jetbrains.kotlin.codegen.CompilationException: Back-end (JVM)
How can I fix this error Android: org.jetbrains.kotlin.codegen.CompilationException: Back-end (JVM)

Time:04-17

I have been having problem compiling the project with this error. and I can't see any helpful solution online

 classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.4.10"


implementation "androidx.room:room-runtime:2.2.6"
implementation "androidx.room:room-ktx:2.2.6"
kapt "androidx.room:room-compiler:2.2.6"



//Anyone with a better approach to solve this

org.jetbrains.kotlin.codegen.CompilationException: Back-end (JVM) Internal error: 
 Couldn't transform method node:
 emit (Ljava/lang/Object;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;:
  @Lorg/jetbrains/annotations/Nullable;() // 
 @Lorg/jetbrains/annotations/NotNull;() 1

CodePudding user response:

This seems like kotlin-codegen issue.. try to update your kotlin and codegen.

implementation "com.squareup.moshi:moshi-kotlin:1.11.0"
implementation "com.squareup.moshi:moshi-adapters:1.11.0"
kapt "com.squareup.moshi:moshi-kotlin-codegen:1.11.0"

update your kotlin also and your room library to latest

 implementation "androidx.room:room-runtime:2.4.2"
 implementation "androidx.room:room-ktx:2.4.2"
 kapt "androidx.room:room-compiler:2.4.2"

and recompilee your code

  • Related