Processing did not complete. See error above for details

在使用HiltAndroidApp时报错 Processing did not complete. See error above for details 解决方法

报错如图
   Task :app:kaptDebugKotlin FAILED
   /Users/luchanglong/work/android/Pinpintu/app/build/tmp/kapt3/stubs/debug/com/ppt/pinpintu/PptApp.java:19: 错误: [Hilt]
   public final class PptApp extends android.app.Application {
                ^
     Expected @HiltAndroidApp to have a value. Did you forget to apply the Gradle Plugin? (dagger.hilt.android.plugin)
     See https://dagger.dev/hilt/gradle-setup.html
     [Hilt] Processing did not complete. See error above for details.警告: Binding adapter AK(android.widget.ImageView, java.lang.String) already exists for imageShowUrl! Overriding com.ppt.pinpintu.db.entity.RecordEntity#imageShowUrl with com.ppt.pinpintu.db.entity.ImageEntity#imageShowUrl警告: Binding adapter AK(android.widget.ImageView, java.lang.String) already exists for imageShowUrl! Overriding com.ppt.pinpintu.db.entity.RecordEntity#imageShowUrl with com.ppt.pinpintu.db.entity.ImageEntity#imageShowUrl警告: Binding adapter AK(android.widget.ImageView, java.lang.String) already exists for imageShowUrl! Overriding com.ppt.pinpintu.db.entity.ImageEntity#imageShowUrl with com.ppt.pinpintu.db.entity.Report#imageShowUrl警告: Binding adapter AK(android.widget.ImageView, java.lang.String) already exists for imageShowUrl! Overriding com.ppt.pinpintu.db.entity.ImageEntity#imageShowUrl with com.ppt.pinpintu.db.entity.Report#imageShowUrl[WARN] Incremental annotation processing requested, but support is disabled because the following processors are not incremental: androidx.room.RoomProcessor (DYNAMIC). 
 Execution failed for task ':app:kaptDebugKotlin'.
   A failure occurred while executing org.jetbrains.kotlin.gradle.internal.KaptExecution
   java.lang.reflect.InvocationTargetException (no error message) 

解决:在app/build.gradle 中将有arguments =xxxx 改为 arguments +=

如:
javaCompileOptions {
    annotationProcessorOptions {
        arguments += ["room.schemaLocation":
                             "$projectDir/schemas".toString()]
    }
}

留下评论