When I bumped up Kotlin version to 1.2.70, my builds started failing with an error:

e: Supertypes of the following classes cannot be resolved. Please make sure you have the required dependencies in the classpath:
    class com.my.app.db.AppDatabase, unresolved supertypes: androidx.room.RoomDatabase

I tried cleaning cache (clean cache from AS menu, Invalidate cache & Restart, then rm -rf build folders in the project) but the error didn't go away. Then I downgraded to previous kotlin version I had (1.2.61) and now it builds successfully.

My Room version: 2.0.0-rc01 (androidx)

Add all Room dependencies in gradle

implementation 'android.arch.persistence.room:rxjava2:1.1.0-alpha2'
implementation 'android.arch.persistence.room:runtime:1.1.0-alpha2'
annotationProcessor "android.arch.persistence.room:compiler:1.1.0-alpha2"

Make sure you have latest library versions for rx and room and then compile it with kotlin 1.2.70

  • I have the latest Room version but what's RX have to do with it? – alashow Sep 14 at 5:51
  • actually nothing you can always use it without rx, but i worked on room database using rxjava and i have experience the same issue it was library version related issue at that time which i resolved and it worked. – Awais Tariq Sep 14 at 6:22
  • I don't think it's related to rxjava. Nevertheless, it's up to date. – alashow Sep 14 at 7:37

Your Answer

 

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.