Ritesh Kumar Gupta
Ritesh Kumar Gupta

Reputation: 5191

Failed to resolve: com.github.manuelpeinado.fadingactionbar:fadingactionbar-abc:3.1.2

I am trying to import a library to my project, it throws following error:

Error:(8, 13) Failed to resolve: com.github.manuelpeinado.fadingactionbar:fadingactionbar-abc:3.1.2 <a href="openFile">Show in File</a><br><a href="open.dependency.in.project.structure">Show in Project Structure dialog</a>

Here is my build.gradle:

apply plugin: 'com.android.application'

dependencies {
    compile fileTree(dir: 'libs', include: '*.jar')
    compile project(':StickyListHeaders')
    compile project(':facebook')
    compile 'com.google.android.gms:play-services:7.5.0'
    compile 'com.android.support:support-v4:22.2.0'
    compile 'com.github.manuelpeinado.fadingactionbar:fadingactionbar-abc:3.1.2'
}

Here is toplevel build.gradle:

// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
    repositories {
        mavenCentral()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:1.2.3'
    }
}

Error details: Error:A problem occurred configuring project ':UIAppTemplate'.

Could not resolve all dependencies for configuration ':UIAppTemplate:_debugCompile'. Could not find com.github.manuelpeinado.fadingactionbar:fadingactionbar-abc:3.1.2. Searched in the following locations: file:/C:/Users/rigupta/AppData/Local/Android/sdk/extras/android/m2repository/com/github/manuelpeinado/fadingactionbar/fadingactionbar-abc/3.1.2/fadingactionbar-abc-3.1.2.pom file:/C:/Users/rigupta/AppData/Local/Android/sdk/extras/android/m2repository/com/github/manuelpeinado/fadingactionbar/fadingactionbar-abc/3.1.2/fadingactionbar-abc-3.1.2.jar file:/C:/Users/rigupta/AppData/Local/Android/sdk/extras/google/m2repository/com/github/manuelpeinado/fadingactionbar/fadingactionbar-abc/3.1.2/fadingactionbar-abc-3.1.2.pom file:/C:/Users/rigupta/AppData/Local/Android/sdk/extras/google/m2repository/com/github/manuelpeinado/fadingactionbar/fadingactionbar-abc/3.1.2/fadingactionbar-abc-3.1.2.jar Required by: android - AS:UIAppTemplate:unspecified Am I doing anything wrong?

Upvotes: 1

Views: 824

Answers (3)

Blasanka
Blasanka

Reputation: 22437

If anyone landed here using maven with url (jitpack), add that inside app -> gradle inside allprojects repositories.

ex:

allprojects {
    repositories {
        google()
        jcenter()
        maven {
            url "https://jitpack.io"
        }
    }
}

Upvotes: 1

Gabriele Mariotti
Gabriele Mariotti

Reputation: 364451

In your build.gradle you have to add

repositories {
    jcenter()
 }

It this way gradle knows where are the dependencies to download.
It is somenthing different from the repositories inside the buildscript block.

Otherwise you can add in the top-level build.gradle file:

allprojects {
    repositories {
        jcenter()
    }
}

Upvotes: 2

curioushikhov
curioushikhov

Reputation: 2838

You forgot dependency

 compile 'com.android.support:appcompat-v7:22.2.1'

Upvotes: 0

Related Questions