3

I tried adding Room to my Jetpack Compose project, as described here: https://developer.android.com/jetpack/androidx/releases/room?authuser=1

I got this: enter image description here

I did this: (as described here: https://stackoverflow.com/a/66114787/20009330) enter image description here

I got this: enter image description here

Here is the github repo: https://github.com/folsze/AudioHub

Chef Lax
  • 89
  • 2
  • 10

2 Answers2

7

You need to add it on the app build.gradle file at the top where it will look like this:

    plugins {
    id 'com.android.application'
    id 'org.jetbrains.kotlin.android'
    id 'kotlin-kapt'
}

At the moment you have it in your project build.gradle file so it's in the wrong place.

Code Poet
  • 6,222
  • 2
  • 29
  • 50
2

The correct way is to add this line in your plugins scope in app level build.gradle

id 'org.jetbrains.kotlin.kapt'