现在必须显式声明注释处理器。- compiler-1.1.1.jar (android.arch.lifecycle:compiler:1.1.1)

Dha*_*apu 3 android android-lifecycle android-paging

我正在尝试将以下库添加到我的应用程序中

   ext {
    roomLibraryVersion = '1.1.0'
    lifeCycleVersion = '1.1.1'
    }

//room data base
implementation "android.arch.persistence.room:runtime:$roomLibraryVersion"
implementation "android.arch.persistence.room:compiler:$roomLibraryVersion"
annotationProcessor "android.arch.persistence.room:compiler:$roomLibraryVersion"

//life cycle
implementation "android.arch.lifecycle:runtime:$lifeCycleVersion"
implementation "android.arch.lifecycle:compiler:$lifeCycleVersion"
implementation "android.arch.lifecycle:extensions:$lifeCycleVersion"


// rx android
implementation 'io.reactivex.rxjava2:rxandroid:2.0.2'
implementation "io.reactivex.rxjava2:rxjava:2.1.14"
implementation 'android.arch.persistence.room:rxjava2:1.1.0'

//paging
implementation 'android.arch.paging:runtime:1.0.0'
Run Code Online (Sandbox Code Playgroud)

我在运行代码时遇到异常。任何人都可以帮我解决这个问题

Execution failed for task ':app:javaPreCompileDebug'.
> Annotation processors must be explicitly declared now.  The following dependencies on the compile classpath are found to contain annotation processor.  Please add them to the annotationProcessor configuration.
    - compiler-1.1.1.jar (android.arch.lifecycle:compiler:1.1.1)

  Alternatively, set android.defaultConfig.javaCompileOptions.annotationProcessorOptions.includeCompileClasspath = true to continue with previous behavior.  Note that this option is deprecated and will be removed in the future.
Run Code Online (Sandbox Code Playgroud)

wox*_*iao 5

更改:
implementation "android.arch.lifecycle:compiler:$lifeCycleVersion"
为:
annotationProcessor "android.arch.lifecycle:compiler:$lifeCycleVersion"