WARNING: API 'variant.getJavaCompiler()' is obsolete and has been replaced with 'variant.getJavaComp

WARNING: API ‘variant.getJavaCompiler()’ is obsolete and has been replaced with ‘variant.getJavaCompileProvider()’.

1.问题
WARNING: API ‘variant.getJavaCompiler()’ is obsolete and has been replaced with ‘variant.getJavaCompileProvider()’.
打包时会打包失败
我出现的原因是因为使用了GreenDao
这个原因是因为Gradle版本高或者不稳定导致的,可以通过降低Gradle版本。

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 more information.
Affected Modules: app

将3.4.2 降低到3.1.2 就解决了这个问题

		//classpath 'com.android.tools.build:gradle:3.4.2'
		classpath 'com.android.tools.build:gradle:3.1.2'
        //butterknife的导入
        classpath 'com.neenbedankt.gradle.plugins:android-apt:1.8'
        classpath 'org.greenrobot:greendao-gradle-plugin:3.2.2'

你可能感兴趣的:(android项目用到)