In my case,I was missing

apply plugin: 'kotlin-kapt'

Hope it helps someone as blind as me.


Here is a working solution for the latest version of android studio instead of apply plugin use id 'kotlin-kapt' inside plugins.

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

So you also forgot to add

apply plugin: 'kotlin-kapt'
apply plugin: 'dagger.hilt.android.plugin'

in app level gradel file. Nice.


Use plugin with this order,

apply plugin: 'com.android.application'
apply plugin: 'com.google.gms.google-services'
apply plugin:  'kotlin-android'
apply plugin: 'kotlin-kapt'
apply plugin: 'dagger.hilt.android.plugin'