Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to use the androidannotations library in kotlin?

Tags:

android

kotlin

I have tried many time using android annotations library in activity with @EActivity. but unfortunately i am failed to declare it in the manifest file with MainActivity_.

@EActivity
class MainActivity : AppCompatActivity(){}

in manifest file

<activity android:name=".MainActivity_">

in this .MainActivity_ not found .

like image 485
Krupa Vachhani Avatar asked Jan 18 '26 17:01

Krupa Vachhani


1 Answers

You probably need to enable kapt (Kotlin Annotation Processing) in your project.

apply plugin: 'kotlin-kapt'

dependencies {
    kapt "org.androidannotations:androidannotations:$AAVersion"
}

Please see https://kotlinlang.org/docs/reference/kapt.html for reference and https://github.com/androidannotations/androidannotations/tree/master/examples/kotlin for an example.

like image 90
Kirill Rakhman Avatar answered Jan 21 '26 06:01

Kirill Rakhman