当前位置:   article > 正文

Gradle编译问题整理(持续更新)_unable to load class 'org.gradle.api.tasks.testing

unable to load class 'org.gradle.api.tasks.testing.abstracttesttask'.

1、Could not find lint-gradle-api.jar (com.android.tools.lint:lint-gradle-api:26.1.2).

maven {url 'https://maven.aliyun.com/reposity/google' }
maven {url 'https://maven.aliyun.com/reposity/jcenter' }
maven {url 'http://maven.aliyun.com/nexus/content/groups/public' }

2、Unable to load class 'org.gradle.api.internal.component.Usage'.

该问题一般均是classpath 'com.novoda:bintray-release:0.8.0'库兼容性导致的,如果有com.novoda:bintray-release请把版本修改为0.5.0;如果AndroidStudio版本大于3.14,请改为0.8.0

3、The specified Android SDK Build Tools version (23.0.2) is ignored, as it is below the minimum supported version (27.0.3) for Android Gradle Plugin 3.1.2.
Android SDK Build Tools 27.0.3 will be used.
To suppress this warning, remove "buildToolsVersion '23.0.2'" from your build.gradle file, as each version of the Android Gradle Plugin now has a default version of the build tools.

这是因为报错原因是因为gradle插件版本以及SDK build Tools 是有关联的,更新AndroidStudio或者gradle时,gradle 插件版本会做相应检测是否符合,不符合版本要求就会报错。

解决方案:直接点击Open File提示,会直接打开文件,将所有提示的地方修改成目标版本,重新编译即可。

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/2023面试高手/article/detail/255320
推荐阅读
相关标签
  

闽ICP备14008679号