I can't import any library using jitpack. My problem is with my own library, but below com.github.jitpack:android-example:1.0.4
is used as an example library provided by jitpack itself that should have worked out of the box. Also note that offline stuff are off in android studio.
Root build.gradle
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.1.2'
}
}
allprojects {
repositories {
google()
jcenter()
mavenCentral()
maven {
name "jitpack"
url "https://jitpack.io"
}
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
App build.gradle
apply plugin: 'com.android.application'
android {
compileSdkVersion 28
defaultConfig {
applicationId "com.me.stuff"
minSdkVersion 26
targetSdkVersion 28
versionCode 1
versionName "1.4"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
multiDexEnabled true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
configurations.all {
resolutionStrategy.force 'com.google.code.findbugs:jsr305:1.3.9'
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
productFlavors {
}
}
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation 'androidx.appcompat:appcompat:1.0.0'
// etc...
implementation 'com.github.jitpack:android-example:1.0.4'
}
configurations.all {
resolutionStrategy {
//force 'com.android.support:support-annotations:27.1.1'
}
}
Error messages
Android studio shows:
ERROR: Failed to resolve: com.github.jitpack:android-example:1.0.4
Show in Project Structure dialog
Affected Modules: app
Running gradle from the command line shows:
Could not resolve all files for configuration ':app:debugCompileClasspath'.
> Could not find com.github.jitpack:android-example:1.0.4.
Searched in the following locations:
// A LOT OF IRRELEVANT LOCAL LOCATIONS OMITTED
https://dl.google.com/dl/android/maven2/com/github/jitpack/android-example/1.0.4/android-example-1.0.4.pom
https://dl.google.com/dl/android/maven2/com/github/jitpack/android-example/1.0.4/android-example-1.0.4.jar
https://jcenter.bintray.com/com/github/jitpack/android-example/1.0.4/android-example-1.0.4.pom
https://jcenter.bintray.com/com/github/jitpack/android-example/1.0.4/android-example-1.0.4.jar
https://repo.maven.apache.org/maven2/com/github/jitpack/android-example/1.0.4/android-example-1.0.4.pom
https://repo.maven.apache.org/maven2/com/github/jitpack/android-example/1.0.4/android-example-1.0.4.jar
https://jitpack.io/com/github/jitpack/android-example/1.0.4/android-example-1.0.4.pom
https://jitpack.io/com/github/jitpack/android-example/1.0.4/android-example-1.0.4.jar