Group Group Group Group Group Group Group Group Group

Chapter 16 P 302: Could not find method kapt()

#1

The book states:
1 to 4 implementation & annotationProcessor, then
// 5
kapt “android.arch.persistence.room:compiler:” + “$room_version”
When run, the error appears:
Could not find method kapt() for arguments [android.arch.persistence.room:compiler:1.0.0] on object of type org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler.

StackOverflow research: Please confirm.
build.gradle (Module: app) add this line to the top after the other apply’s
apply plugin: ‘kotlin-kapt’

#2

@tblank Can you please help with this when you get a chance? Thank you - much appreciated! :]

1 Like
#3

Hi @mazen_kilani,

Thank you for bringing this to our attention!

It appears that the project did work without the additional kapt plugin at some point, but adding apply plugin: 'kotlin-kapt' to the app build.gradle file is the proper way to resolve this issue.

We will make sure this is updated in the next version of the book.

Thanks,
Tom