Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Using annotation frames in Kotlin does not work.

2025-02-27 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/03 Report--

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)

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report