我是靠谱客的博主 无奈烧鹅,最近开发中收集的这篇文章主要介绍WARNING: API 'variant.getJavaCompiler()' is obsolete and has been replaced with 'variant.getJavaCompWARNING: API ‘variant.getJavaCompiler()’ is obsolete and has been replaced with ‘variant.getJavaCompileProvider()’.,觉得挺不错的,现在分享给大家,希望可以做个参考。

概述

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'

最后

以上就是无奈烧鹅为你收集整理的WARNING: API 'variant.getJavaCompiler()' is obsolete and has been replaced with 'variant.getJavaCompWARNING: API ‘variant.getJavaCompiler()’ is obsolete and has been replaced with ‘variant.getJavaCompileProvider()’.的全部内容,希望文章能够帮你解决WARNING: API 'variant.getJavaCompiler()' is obsolete and has been replaced with 'variant.getJavaCompWARNING: API ‘variant.getJavaCompiler()’ is obsolete and has been replaced with ‘variant.getJavaCompileProvider()’.所遇到的程序开发问题。

如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(62)

评论列表共有 0 条评论

立即
投稿
返回
顶部