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

本文解决了一个在AndroidStudio中常见的编译问题,涉及到第三方插件com.novoda:bintray-release与Gradle版本不兼容的情况。通过更新依赖版本,可以避免Unabletoloadclass'org.gradle.api.internal.component.Usage'的错误。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

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

AndroidStudio 编译时出现的问题:

Build Log :

Your project may be using a third-party plugin which is not compatible with the other plugins in the project or the version of Gradle requested by the project

您的项目可能正在使用第三方插件,该插件与项目中的其他插件或项目请求的Gradle版本不兼容

查看引用plugin:

apply plugin: 'com.novoda.bintray-release'

查看Project 的build.gradle

dependencies {
    classpath 'com.android.tools.build:gradle:3.4.0'
    classpath 'com.novoda:bintray-release:0.3.4'
    // NOTE: Do not place your application dependencies here; they belong
    // in the individual module build.gradle files
}

com.novoda:bintray-release这个库的作用?
这是将库发布到bintray的工具。 它旨在帮助配置与maven和bintray相关的东西。 目前它适用于Android库项目,普通Java和普通Groovy项目,但该库重点是主要支持Android项目。

详细:

Android 上传自己的开源库到Bintray

进入Github 该项目地址

更新Project 的build.gradle中的bintray-release的版本

dependencies {
    classpath 'com.android.tools.build:gradle:3.4.0'
    classpath 'com.novoda:bintray-release:0.9.1'
    // NOTE: Do not place your application dependencies here; they belong
    // in the individual module build.gradle files
}

然后重新编译

参考:无法加载类 org.gradle.api.internal.component.Usage解决办法

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值