How to resolve this error when using Room Persistence Library with Kotlin?

Asked

Viewed 184 times

0

When I send run the app, I get a crash like this on the first call to the database:

java.lang.RuntimeException: Unable to start activity ComponentInfo{.../....ActivityLogin}: java.lang.RuntimeException: cannot find implementation for ....database.AppDatabase. AppDatabase_Impl does not exist

My database-related dependencies:

compile "android.arch.persistence.room:runtime:1.0.0"
annotationProcessor "android.arch.persistence.room:compiler:1.0.0"

P.S.: I am not using Kapt in my application.

  • 2

    "I am not using Kapt in my application." - but you should be if you want to use the Room in Kotlin.

1 answer

0

@ramaral solved the mystery!

If you Previously used the Android support for Annotation Processors, replace usages of the annotationProcessor Configuration with Kapt. If your project contains Java classes, Kapt will also take care of them.

source

Browser other questions tagged

You are not signed in. Login or sign up in order to post.