当前位置:网站首页>Solve the problem that kotlin writes the Android project compilation report execution failed for task ': app:kaptdebugkotlin'. Exception
Solve the problem that kotlin writes the Android project compilation report execution failed for task ': app:kaptdebugkotlin'. Exception
2022-07-23 15:07:00 【ErwinNakajima】
solve kotlin Write Android Project compilation report Execution failed for task ‘:app:kaptDebugKotlin‘. abnormal
The error reporting Title encountered is also app:kaptDebugKotlin, The specific error information is not , You can also try this method .
Try something : take kapt Change it to annotationProcesser( solve ), And synchronize the project
My project uses room, It was originally introduced like this :
//kotlin databinding
kapt "com.android.databinding:compiler:4.1.1"
//Android route ( For different app Jump between )
implementation 'com.alibaba:arouter-api:1.5.0'
kapt 'com.alibaba:arouter-compiler:1.2.2'
If it is written like this, it will report an error , use annotationProcessor Replace kapt, And synchronize the project is no problem :
//kotlin databinding
annotationProcessor "com.android.databinding:compiler:4.1.1"
//Android route ( For different app Jump between )
implementation 'com.alibaba:arouter-api:1.5.0'
annotationProcessor 'com.alibaba:arouter-compiler:1.2.2'
But in kotlin Shouldn't we use kapt Replace annotationProcessor Do you , It took me a long time to run my own project , It's been a long time kapt The problem of , There was nothing wrong with the project , Deleted customized BaseActivity and BaseFragment, Build the project directly , I can't find the wrong report BaseActivity and BaseFragment, hold BaseActivity and BaseFragment Change to BaseRxActivity and BaseRxFragment, Build the project , I can't find the wrong report BaseActivity and BaseFragment, hold BaseActivity and BaseFragment Change to BaseRxActivity and BaseRxFragment, Build the project ( Some more BaseActivity and BaseFragment The replacement is not complete ), There is such a problem , This problem is difficult to encounter for thousands of years ,
May be kotlin The reason for compiling , Many methods that can be tried have been tried , Still keep reporting this error , After changing a part of the original , Build without error ,Rebuild Don't complain , Run to the mobile phone or simulator and start to report errors app:kaptDebugKotlin, Got it 3 It has been reporting errors for more than an hour app:kaptDebugKotlin, Finally, use this scheme to kapt Changed to annotationProcessor, Then the synchronization , Then run it to the mobile phone or simulator ,
At this time, I found that the code reported an error ( It's strange , Build and Rebuild Never report an error , Clear the cache and restart without error , Turn it off and on again Android Studio Don't complain , Build and Rebuild Never report an error , hold kapt Changed to annotationProcessor, An error is reported after synchronization , The error is reported because it cannot be found BaseActivity and BaseFragment), And then put BaseActivity and BaseFragment Change to BaseRxActivity and BaseRxFragment, Build the project , I found that some pages reported errors and could not be found BaseActivity and BaseFragment, Just keep changing , After the change, run to the mobile phone or simulator , It's wrong not to report ...
But there will be some warnings , And then use kapt Replace annotationProcessor, And synchronize the project is no problem
//kotlin databinding
kapt "com.android.databinding:compiler:4.1.1"
//Android route ( For different app Jump between )
implementation 'com.alibaba:arouter-api:1.5.0'
kapt 'com.alibaba:arouter-compiler:1.2.2'Yes , What's going on ,Android Studio It's really fucking strange ...
If in doubt , Please contact the qq1164688204.
recommend Android Open source project
Project function introduction :RxJava2 and Retrofit2 project , Add automatic management token function , add to RxJava2 Life cycle management , Use App Architecture design is MVP Patterns and MVVM Pattern , Use componentization at the same time , Part of the code uses Kotlin, This project is under continuous maintenance .
Project address :https://gitee.com/urasaki/RxJava2AndRetrofit2
边栏推荐
- 152. Product maximum subarray
- 报错 | cannot read property ‘_normalized‘ of undefined
- Detailed tutorial of typora drawing bed configuration
- 易基因|靶基因DNA甲基化测序(Target-BS)
- C thread lock and single multithreading are simple to use
- Advanced operation and maintenance 02
- raid homes and plunder houses!
- Supervisor installation and use
- @Feignclient detailed tutorial (illustration)
- 多项式承诺Polynomial commitment方案汇总
猜你喜欢

基于matlab的BOC调制解调的同步性能仿真,输出跟踪曲线以及不同超前滞后码距下的鉴别曲线

Cloud native observability tracking technology in the eyes of Baidu engineers

Monotonous stack!!!

RSA加密的使用
![[test platform development] 21. complete sending interface request and display response header information](/img/53/42411ceb6e0e304355ddc396ea2922.png)
[test platform development] 21. complete sending interface request and display response header information

String function of MySQL function summary

真人踩过的坑,告诉你避免自动化测试常犯的10个错误

如何实现多个传感器与西门子PLC之间485无线通讯?

MariaDB 数据库升级版本

头部姿态估计原理及可视化_loveliuzz的博客-程序员宅基地_头部姿态估计
随机推荐
Live classroom system 02 build project environment
Advanced operation and maintenance 02
他山之石 | 阿里多模态知识图谱探索与实践
Common JS modular specification from a code question
直播课堂系统03-model类及实体
[untitled]
Selenium in the crawler realizes automatic collection of CSDN bloggers' articles
Zhongwang CAD professional 2022 software installation package download and installation tutorial
Opencv calculation outsourcing rectangle
Axure进阶
Liunx:浅析vim编辑器基本使用
turbo编译码误码率性能matlab仿真
General of MySQL_ Log log
MySQL 常用命令
深度学习单图三维人脸重建
广州举办镇街农产品质量安全监管员大比武
supervisord安装使用
Simulation of synchronization performance of BOC modulation and demodulation based on MATLAB, output tracking curve and identification curve under different lead lag code distance
报错 | cannot read property ‘_normalized‘ of undefined
智头条:智装论坛将于8月4日举行,2022全屋智能销售将破100亿