[Android] Kotlin + Dagger2: Unresolved reference AppComponent when generating signed APK

I was having this error when deploying a signed APK of my App, running and debugging were both working fine.
After two hours fighting this issue, this was the solution

app/build.gradle


kapt {
generateStubs = true
}

dependencies {
....
}

I placed the “kapt” block before the “dependencies” one and after “android”. Now I can deploy signed APKs

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s