Sanved
Sanved

Reputation: 941

Android Studio : Failed to resolve <github dependency>

Let me first start of by saying that I just recently migrated to Android Studio and being totally honest I didn't like it. Now there is this git I am trying to import into my project - https://github.com/ongakuer/CircleIndicator Although the compile statement which the owner has asked to put creates the error. I added it into the dependency{} in my build.gradle file.

compile 'me.relex:circleindicator:1.1.5@aar'

Failed to resolve: me.relex:circleindicator:1.1.5@aar

Upvotes: 2

Views: 3620

Answers (2)

Kassisdion
Kassisdion

Reputation: 355

You probably had forgotten this line under your gradle :

allprojects {
    repositories {
        jcenter()
    }
}

Edit the root gradle located in root/build.gradle

I'll just explain a little :

When you add this line : compile 'repository or jar url', it prompts your gradle that it should find the repository (or the jar) and add it to your source.

But where should it search for this particular repository ? That is the purpose of this line, to declare a location from where the gradle should search from. In most of the cases it is - jcenter (see this link)

Upvotes: 4

Roman Pozdnyakov
Roman Pozdnyakov

Reputation: 408

Just open build.gradle(Module:app) and copy pase on your dependencies

dependencies {
compile 'me.relex:circleindicator:1.1.5@aar'
}

Upvotes: 0

Related Questions