3

I'm trying to import a library using jitpack.io. Here's my top-level build.gradle:

buildscript {
    repositories {
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:1.5.0'

        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

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

and here's my app/build.gradle:

apply plugin: 'com.android.application'

android {
    compileSdkVersion 23
    buildToolsVersion "23.0.0"

    defaultConfig {
        applicationId "com.domain.app"
        minSdkVersion 19
        targetSdkVersion 23
        versionCode 1
        versionName "1.0"
    }

    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    compile fileTree(include: ['*.jar'], dir: 'libs')
    compile 'com.android.support:appcompat-v7:23.0.0'
    compile files('libs/Parse-1.9.1/Parse-1.9.1.jar')
    compile files('libs/Parse-1.9.1/bolts-android-1.2.0.jar')
    compile 'com.github.deano2390:MaterialShowcaseView:1.0.6'

}

and I keep getting : Error:(27, 13) Failed to resolve: com.github.deano2390:MaterialShowcaseView:1.0.6 without any additional information.

I've also tried with a sffuix as advised by the library's auther:

compile 'com.github.deano2390:MaterialShowcaseView:1.0.6@aar'
shebang
  • 79
  • 1
  • 7

6 Answers6

1

Add your repository in app/build.gradle like below

apply plugin: 'com.android.application'
repositories {
    maven {
        url "https://jitpack.io"
    }

}
android {
    compileSdkVersion 23
    buildToolsVersion "23.0.0"

    defaultConfig {
        applicationId "com.domain.app"
        minSdkVersion 19
        targetSdkVersion 23
        versionCode 1
        versionName "1.0"
    }

    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    compile fileTree(include: ['*.jar'], dir: 'libs')
    compile 'com.android.support:appcompat-v7:23.0.0'
    compile files('libs/Parse-1.9.1/Parse-1.9.1.jar')
    compile files('libs/Parse-1.9.1/bolts-android-1.2.0.jar')
    compile 'com.github.deano2390:MaterialShowcaseView:1.0.6'

}
waleedsarwar86
  • 2,354
  • 1
  • 19
  • 21
1

Everything looks correct in your Gradle files. Your gradle plugin must not be picking up the JitPack repository for some reason.

See if you can resolve the JitPack test library:

compile 'com.github.jitpack:android-example:1.0.4'

If this cannot be resolved then it must be a configuration issue with your IDE / Gradle plugin / Machine.

Dean Wild
  • 5,886
  • 3
  • 38
  • 45
  • 1
    ideed test libarary fails as well. machine/IDE are fully accessible to to world (android studio preforms self updating successfuly), no proxy defined and gradle in **not** in offline mode. – shebang Mar 15 '16 at 07:34
0

I had the same problem until I update and reconfigure my IDE and my JDK version (to jdk 8, you can set it on build options)

Then I followed the basic instructions (add JitPack repo in build.gradle on allprojects and the lib)

Also ensure that your min SDK doesn't be smaller than the declared in the lib

diegod3v
  • 654
  • 6
  • 7
0

I have a library project which depends on a library served from jitpack. In my case, adding the following to my library's build.gradle resolved the issue:

allprojects { p ->
    p.repositories {
        maven { url "https://jitpack.io" }
    }
}
guy.gc
  • 3,359
  • 2
  • 24
  • 39
0

Make sure add maven { url "https://jitpack.io" } as the first respository. I am using android studio 3.3 and have the same issue. for some reason libraries in jitpack are fetched from google and jcenter and cant locate it. re-order the repos fix this for me hope its helpful to someone

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

    }
}
Geolynx
  • 1
  • 1
0

enter image description here

Open settings.gradle file and add the below line inside repositories (as shown in above picture)

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

And remove below code from project's build.gradle file

allprojects {
repositories {
    jcenter()
    maven { url "https://jitpack.io" }
}}
Nikhil Soni
  • 701
  • 7
  • 12