I had this issue and solved this by adding the repository in buildscript. Here you can see my build.gradle (not the module, but the project one) :

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

buildscript {

repositories {

maven { url "https://jitpack.io" }

}

dependencies {

classpath 'com.android.tools.build:gradle:2.2.3'

// NOTE: Do not place your application dependencies here; they belong

// in the individual module build.gradle files

}

}

allprojects {

repositories {

maven { url "https://jitpack.io" }

}

}

task clean(type: Delete) {

delete rootProject.buildDir

}

I don't know why I needed to do that because one my friend just added the repository in the allprojects block and it works for him.

Logo

开放原子开发者工作坊旨在鼓励更多人参与开源活动,与志同道合的开发者们相互交流开发经验、分享开发心得、获取前沿技术趋势。工作坊有多种形式的开发者活动,如meetup、训练营等,主打技术交流,干货满满,真诚地邀请各位开发者共同参与!

更多推荐