Gradle/Android Studio doesn't pull dependencies from specified repositories

NOTE: This is a followup of my last question that still remained unsolved.

I'm using a fully updated AndroidStudio with the default gradle support. Android Studio can self update (thus sees Internet for sure). I have no reason to beleive that Gradle can't reach the internet nor any error that could imply that, and I verified that it's not on offline mode.

Here's my 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 'com.github.jitpack:android-example:1.0.4'  
}

Here I'm trying to pull the jitpack.io sample, and still getting:

Error:(31, 13) Failed to resolve: com.github.jitpack:android-example:1.0.4

without any additional information.

Answers


try this :

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

allprojects {
    repositories {
        jcenter()
    }
}

Then in your app/build.gradle :

apply plugin: 'com.android.application'

repositories {
    maven { url "https://jitpack.io" }
    flatDir {
        dirs 'libs'
    }
}


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 'com.github.jitpack:android-example:1.0.4'  
}

Its not the problem of android studio, To inform you

Neither

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

Nor

compile 'com.github.User:Repo:Tag'

Both doesn't compile now, Because it's no longer available in the The Central Repository. You don't have any ways rather than seeing the codes inside.


Need Your Help

C++ QueryPerformanceCounter more accurate than sleep?

c++ windows

I found an example of QueryPerformanceCounter,