gpt4 book ai didi

maven - 我在 Android Studio 中出现 gradle 同步错误, "Could not find method calsspath() for arguments [com.github.dcendents:android-maven-gradle-plugin:2.0]"

转载 作者:行者123 更新时间:2023-12-03 05:46:22 26 4
gpt4 key购买 nike

我试图在 Github 上建立公共(public)图书馆。
我在 gradles 上放了一些关键字。

-------------(build.gradle) 用于模块----------------

apply plugin: 'com.android.library'
apply plugin: 'com.github.dcendents.android-maven'
group='com.home'
version='1.0'
...

-------------(build.gradle) 用于项目--------------
buildscript {
dependencies {
classpath 'com.android.tools.build:gradle:3.1.1'
calsspath 'com.github.dcendents:android-maven-gradle-plugin:2.0'
....

我想我正确输入了所有关键字。但它不断产生
如下所示的同步错误消息。
"Could not find method calsspath() for arguments [com.github.dcendents:android-maven-gradle-plugin:2.0] on object of type org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler."
我的毕业版本是4.4。

有点帮助,请。

最佳答案

gradle 插件的依赖必须在 buildscript 中定义 block 在构建文件的开头。在一个简单的单模块项目中,它看起来像这样:

buildscript {
dependencies {
classpath 'com.android.tools.build:gradle:3.1.1'
classpath 'com.github.dcendents:android-maven-gradle-plugin:2.0'
}
}

apply plugin: 'com.android.library'
apply plugin: 'com.github.dcendents.android-maven'

如果是多模块项目,则需要输入 buildscript阻止您的根项目。

关于maven - 我在 Android Studio 中出现 gradle 同步错误, "Could not find method calsspath() for arguments [com.github.dcendents:android-maven-gradle-plugin:2.0]",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50003429/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com