Fail to resolve third-party libraries

Issue

I download a Android Studio project from https://github.com/chenyangcun/MaterialDesignExample . I add it to my Android Studio and run it,but there occurs some errors:

enter image description here

The blew is the build.gradle file:

apply plugin: 'com.android.application'

android {
    compileSdkVersion 21
    buildToolsVersion "21.1.2"

    defaultConfig {
        applicationId "com.aswifter.materialexample"
        minSdkVersion 15
        targetSdkVersion 21
        versionCode 1
        versionName "1.0"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    compile 'com.android.support:design:22.2.1'
    compile 'com.android.support:appcompat-v7:22.2.1'
    compile 'com.android.support:cardview-v7:22.2.1'
    compile 'com.android.support:recyclerview-v7:22.2.1'

    compile 'com.github.bumptech.glide:glide:3.6.0'
    compile 'de.hdodenhof:circleimageview:1.3.0'

    compile 'com.loopj.android:android-async-http:1.4.7'
    compile 'com.google.code.gson:gson:2.3'
    compile 'com.afollestad:material-dialogs:0.7.6.0'
}

And then I build a whole new Android project with the same “third-party libraries”
The blew is my bulid.gradle file:

apply plugin: 'com.android.application'

android {
    compileSdkVersion 23
    buildToolsVersion "23.0.0"

    defaultConfig {
        applicationId "com.mummyding.app.test"
        minSdkVersion 15
        targetSdkVersion 23
        versionCode 1
        versionName "1.0"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {

     compile fileTree(dir: 'libs', include: ['*.jar'])
    compile 'com.android.support:appcompat-v7:23.0.0'
    compile 'com.android.support:design:22.2.1'

    compile 'com.android.support:cardview-v7:22.2.1'
    compile 'com.android.support:recyclerview-v7:22.2.1'
    compile 'com.github.bumptech.glide:glide:3.6.0'
    compile 'de.hdodenhof:circleimageview:1.3.0'

    compile 'com.loopj.android:android-async-http:1.4.7'
    compile 'com.google.code.gson:gson:2.3'
    compile 'com.afollestad:material-dialogs:0.7.6.0'
}

What confuses me is the “error info”:

enter image description here

compile ‘de.hdodenhof:circleimageview:1.3.0’ is okay in this project!!!
so my questions:

  1. Can you run this project in your Andorid Studio?

  2. Why the “error info” different?

  3. How to fix it?

PS:
Gradle Version : 2.2.1
IDE: Android Studio 1.2.1.1
OS: Ubuntu 15.04
I am in China but I have got a router with shadowsocks (which means I can visit any website I want)
It really confuse me for a long time,so any suggestion will be highly appreciated,thank you advance.

Solution

I fixed it!!!!
It’s not caused by GFW .It works well when I replaced OpenJDK with Oracle-JDK on my ubuntu!

Answered By – MummyDing

This Answer collected from stackoverflow, is licensed under cc by-sa 2.5 , cc by-sa 3.0 and cc by-sa 4.0

Leave a Reply

(*) Required, Your email will not be published