gpt4 book ai didi

android - Gradle DSL 方法未找到 : 'credentials()'

转载 作者:行者123 更新时间:2023-12-03 05:01:39 29 4
gpt4 key购买 nike

在接受 this SO post 的答案之后,我正在尝试使用 BitBucket API 从我的私有(private) BitBucket 帐户添加依赖项。 .

我的项目根级 build.gradle 文件:

// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:1.3.0'

// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}

allprojects {
repositories {
jcenter()
maven {
url 'https://bitbucket.org/api/2.0/repositories/{user}/{repo}/commit/{tag_num}'
}
credentials {
username 'my_username'
password 'my_password'
}
}
}

我收到以下错误:
Error:(21, 0) Gradle DSL method not found: 'credentials()'
Possible causes:
- The project 'USPLibraryClerk' may be using a version of Gradle that does not contain the method.
- The build file may be missing a Gradle plugin.

如果我移动 credentials {}maven {}里面 block ,在获取我的 repo 方面似乎没有任何更新。
maven {
url 'https://bitbucket.org/api/2.0/repositories/{user}/{repo}/commit/{tag_num}'
credentials {
username 'my_username'
password 'my_password'
}
}

如何修复此错误消息?

最佳答案

你可以使用这样的东西:

repositories {
jcenter()
maven {
credentials {
username 'xxxx'
password 'xxxx'
}
url 'http://xxxxxxxx/repositories/releases/'
}
}

这里 official doc .

关于android - Gradle DSL 方法未找到 : 'credentials()' ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32695686/

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