android - Gradle DSL method not found: 'credentials()' -


i trying add dependency private bitbucket account using bitbucket api following accepted answer this post.

my project root level build.gradle file:

// top-level build file can add configuration options common sub-projects/modules.  buildscript {     repositories {         jcenter()     }     dependencies {         classpath 'com.android.tools.build:gradle:1.3.0'          // note: not place application dependencies here; belong         // in 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'         }     } } 

i following error:

error:(21, 0) gradle dsl method not found: 'credentials()' possible causes:     - project 'usplibraryclerk' may using version of gradle not contain method.     - build file may missing gradle plugin. 

if move credentials {} inside maven {} block, nothing seems update in terms of getting repo.

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

how fix error message?

you can use somenthing this:

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

here official doc.


Comments

Popular posts from this blog

java - Date formats difference between yyyy-MM-dd'T'HH:mm:ss and yyyy-MM-dd'T'HH:mm:ssXXX -

c# - Get rid of xmlns attribute when adding node to existing xml -