Get the App
SLTechnology News&Howtos  ›  Internet Technology  › 

Using annotation frames in Kotlin does not work.

Shulou Source: shulou.com Published: 2022-06-03 06:52:29 10月04日 Update

The problem uses the annotation framework in Kotlin and finds that the annotated fields are not valid at compile time. Because Kotlin is based on the jvm runtime development language, you need to introduce annotated environment solutions to it separately: this way is based on Gradle, such as using the development tool InterJect,Android Studio, other configuration Gradle compilation environment; just add the kapt plug-in and the corresponding annotation processing in the Module of the Kotlin or the build.gradle file of the program.

Steps:

1. Introduce the annotation plug-in of kotlin into the program or Module

2. Add annotation dependency handling (annotationProcessor may have been used previously, just replace it)

Tags: Annotations plug-ins methods environment programs processing development compilation framework reasons fields tools development tools files methods times steps languages problems Riga Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Microsoft Redmi Linux Shulou Information MariaDB