0

この SO 投稿に対する受け入れられた回答に従って、BitBucket API を使用してプライベート 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 {}to をブロック内に移動するとmaven {}、リポジトリの取得に関して何も更新されないようです。

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

このエラー メッセージを修正するにはどうすればよいですか?

4

1 に答える 1