Java 无法解析第三方库

Java 无法解析第三方库,java,android,android-studio,gradle,Java,Android,Android Studio,Gradle,我从下载了一个Android Studio项目。我将它添加到我的Android Studio并运行它,但出现了一些错误: 文件名是build.gradle文件: apply plugin: 'com.android.application' android { compileSdkVersion 21 buildToolsVersion "21.1.2" defaultConfig { applicationId "com.aswifter.mate

我从下载了一个Android Studio项目。我将它添加到我的Android Studio并运行它,但出现了一些错误:

文件名是build.gradle文件:

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'
}
然后我用同样的“第三方库”构建了一个全新的Android项目
下面是我的bulid.gradle文件:

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'
}
让我困惑的是“错误信息”:

在这个项目中编译'de.hdodenhof:circleimageview:1.3.0'是可以的
所以我的问题是:

  • 你能在你的工作室里运行这个项目吗

  • 为什么“错误信息”不同

  • 如何修复它

  • 附言:
    渐变版本:2.2.1
    IDE:Android Studio 1.2.1.1
    操作系统:Ubuntu 15.04
    我在中国,但我有一个带shadowsocks的路由器(这意味着我可以访问我想要的任何网站)

    这真的让我困惑了很长一段时间,所以任何建议都将不胜感激,谢谢您。问题可能是您的代理设置。您可能需要在
    gradle.properties
    中设置以下内容(请根据您的代理设置进行修改):

    我修好了!!!!
    这不是由GFW引起的。当我在ubuntu上用Oracle JDK替换OpenJDK时,效果很好

    你是说文件->设置->系统设置->Http代理?如果是这样,我选中了“无代理”选项(默认设置)。我没有看到任何像systemProp.http这样的行。在我的gradle.properties。此外,我不知道如何“根据我的代理设置进行修改”。很抱歉,我对代理一无所知。我只是添加了几行:'systemProp.http.proxyHost=127.0.0.1 systemProp.http.proxyPort=8123 systemProp.https.proxyHost=127.0.0.1 systemProp.https.proxyPort=8123',但这并没有任何区别,因为你提到了shadowsocks(你可以在浏览器中访问谷歌等?)您的浏览器中可能已经有一些代理设置。请检查您的web浏览器配置中是否有任何代理设置。还没有,我在路由器中进行了配置,我不需要在PC中执行任何操作。如果我的手机/PC连接到我的wifi,我可以使用它们访问Google等。也许您有一个透明的代理?请先注释掉您在gradle.properties中添加的行。为了确定,请检查是否将gradle设置为脱机模式
    systemProp.http.proxyHost=127.0.0.1
    systemProp.http.proxyPort=8123
    systemProp.https.proxyHost=127.0.0.1
    systemProp.https.proxyPort=8123