android - 添加 kotlin-kapt 导致 Can not resolve symbol DaggerApplicationComponent 错误

标签 android kotlin realm dagger-2 dagger

Dagger 目前我还没有任何问题,因为我没有在我的项目中添加 Realm,在我的项目中添加之后我希望我可以成功构建我的项目,但我现在收到此错误:

Can not resolve symbol DaggerApplicationComponent

我想在我的应用程序中需要 Realm 并且我无法删除它,但是我在 Logcat 上没有收到任何其他错误以了解问题所在,我应该解决这个问题,我不确定如何解决这个问题

当我在 build.gradle 中有这行时我没有问题

apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'com.jakewharton.hugo'
apply plugin: 'com.novoda.bintray-release'

但是在添加 Realm 之后我得到了

Configuration with name 'kapt' not found

错误,在将 kotlin-kapt 添加到此文件后,我得到了

Can not resolve symbol DaggerApplicationComponent

错误,例如:

apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'kotlin-kapt'
apply plugin: 'com.jakewharton.hugo'
apply plugin: 'com.novoda.bintray-release'
apply plugin: 'realm-android'

最佳答案

问题已解决,将 annotationProcessor 更改为 kapt

关于android - 添加 kotlin-kapt 导致 Can not resolve symbol DaggerApplicationComponent 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54769574/

相关文章:

java - 私有(private)内部类的构造函数也是私有(private)的吗?

android - classes.jar' 已经包含条目 'META-INF/module_name_debug.kotlin_module' ,无法覆盖

swift - 如何创建 Realm 列表的扩展?

json - 如何在 Swift 的 Alamofire 中发送 body 参数?

swift - 如何在 Realm 中仅保存一个类实例

Android 使用 Camera.setPreviewCallback 中的位图的方法

android - 如何清除 View 分页器 fragment

android - 我可以在没有 'page=number' 查询的情况下将 Paging3 库用于 API 吗?

android - 有官方的Android section View吗?

android - Parcelize 在对象和枚举上提示 "Parcelable should be a class"