当我使用'org.greenrobot:greendao-gradle-plugin:3.2.2'编译版本时,出现错误:
WARNING: API 'variant.getJavaCompiler()' is obsolete and has been replaced with 'variant.getJavaCompileProvider()'.
It will be removed at the end of 2019.
For more information, see https://d.android.com/r/tools/task-configuration-avoidance.
To determine what is calling variant.getJavaCompiler(), use -Pandroid.debug.obsoleteApi=true on the command line to display a stack trace.
Affected Modules: app
我尝试执行命令, gradlew -Pandroid.debug.obsoleteApi = true ,我得到:
>gradlew -Pandroid.debug.obsoleteApi=true
> Configure project :app
WARNING: API 'variant.getJavaCompiler()' is obsolete and has been replaced with 'variant.getJavaCompileProvider()'.
It will be removed at the end of 2019.
For more information, see https://d.android.com/r/tools/task-configuration-avoidance.
REASON: It is currently called from the following trace:
java.lang.Thread.getStackTrace(Thread.java:1552)
com.android.build.gradle.internal.errors.DeprecationReporterImpl.reportDeprecatedApi(DeprecationReporterImpl.kt:79)
com.android.build.gradle.internal.api.BaseVariantImpl.getJavaCompiler(BaseVariantImpl.java:447)
com.android.build.gradle.internal.api.ApplicationVariantImpl_Decorated.getJavaCompiler(null:-1)
org.greenrobot.greendao.gradle.AndroidPluginSourceProvider.addGeneratorTask(SourceProvider.kt:62)
org.greenrobot.greendao.gradle.AndroidPluginSourceProvider$addGeneratorTask$1.execute(SourceProvider.kt:46)
org.greenrobot.greendao.gradle.AndroidPluginSourceProvider$addGeneratorTask$1.execute(SourceProvider.kt:27)
org.gradle.api.internal.DefaultDomainObjectCollection.all(DefaultDomainObjectCollection.java:158)
org.greenrobot.greendao.gradle.AndroidPluginSourceProvider.addGeneratorTask(SourceProvider.kt:45)
org.greenrobot.greendao.gradle.Greendao3GradlePlugin$apply$1.execute(Greendao3GradlePlugin.kt:50)
org.greenrobot.greendao.gradle.Greendao3GradlePlugin$apply$1.execute(Greendao3GradlePlugin.kt:14)
org.gradle.configuration.internal.DefaultListenerBuildOperationDecorator$BuildOperationEmittingAction$1$1.run(DefaultListenerBuildOperationDecorator.java:155)
... ...
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:55)
java.lang.Thread.run(Thread.java:745)
WARNING: Debugging obsolete API calls can take time during configuration. It's recommended to not keep it on at all times.
尽管此问题将在2020年爆发,但我希望尽快在下一个版本中解决。