The problem

The following error is reported when configuring autoService

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.

Auto – service – 1.0 – rc7. Jar (com. Google. Auto. Services: auto – service: 1.0 – rc7) 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. See Developer.android.com/r/tools/ann… for more details.

The solution

DefaultConfig in build.gradle(app)

android { ... defaultConfig { ... }}Copy the code

Add the configuration

        javaCompileOptions { annotationProcessorOptions { includeCompileClasspath = true } 
Copy the code