Krupa Vachhani
Krupa Vachhani

Reputation: 53

How to use the androidannotations library in 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 .

Upvotes: 3

Views: 2711

Answers (2)

G. Kh.
G. Kh.

Reputation: 306

And also you have to declare annotated class as open , cause by default all classes in Kotlin are final

Upvotes: 0

Kirill Rakhman
Kirill Rakhman

Reputation: 43861

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.

Upvotes: 7

Related Questions