Android : Android Studio 3.4更新至gradle 5.1.1的问题

 

WARNING: API 'variant.getPackageLibrary()' is obsolete and has been replaced with 'variant.getPackageLibraryProvider()'.
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.getPackageLibrary(), use -Pandroid.debug.obsoleteApi=true on the command line to display more information.
Affected Modules: bureau_of_education

android studio 升级为3.4版本后.大部分都是出现这种类似的警告.

看见这种警告,我的感觉是特别烦的.总想着把他成功去除警告才有成就感.

解决方法很简单:

1. 把项目切换成project..

2.找到与app同级的build.gradle

3.将buildscript->dependencies->classpath 里面的依赖更新为有效的最新版本

buildscript {

    repositories {
        ......
          maven {
            url 'https://maven.fabric.io/public'
         }
    }
    dependencies {
        ......
        classpath 'com.android.tools.build:gradle:3.4.0'//最新androidStudio版本
        classpath 'io.fabric.tools:gradle:1.28.0' //更新为最新依赖
        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

4.重新make project 项目(快捷键ctrl+f9).

 

知道方法了很简单.不知道每次都出现警告影响coding心情.

希望能对你带来帮助!!!!!!!

微信加好友可以共同进步

  • 2
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值