Reputation: 79
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'
Upvotes: 3
Views: 4002
Reputation: 939
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" }
}}
Upvotes: 0
Reputation: 11
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()
}
}
Upvotes: 1
Reputation: 3501
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" }
}
}
Upvotes: 0
Reputation: 674
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
Upvotes: 0
Reputation: 5954
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.
Upvotes: 1
Reputation: 2374
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'
}
Upvotes: 1