Android Studio 无法解析第三方库

igetnqfo  于 2022-11-16  发布在  Android
关注(0)|答案(3)|浏览(205)

我 从 https://github.com/chenyangcun/MaterialDesignExample 下载 了 一 个 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 项目
吹 是 我 的 建设 。 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 ' 是 可以 ! ! !
所以 我 的 问题 是 :
1.您 可以 在 Andorid Studio 中 运行 this 项目 吗 ?
1.为什么 " 错误 信息 " 不同 ?
1.如何 修复 ?
附言 :
Gradle 版本 :2.2.1
IDE: Android Studio 1.2.1.1
操作 系统 : Ubuntu 15.04
我 在 中国 , 但 我 有 一 个 带有 影子 袜子 的 路由 器 ( 这 意味 着 我 可以 访问 任何 我 想 要 的 网站 )
这 真 的 让 我 困惑 了 很 长 一 段 时间 , 所以 任何 建议 都 将 高度 赞赏 , 提前 感谢 。

dbf7pr2w

dbf7pr2w1#

问题可能出在您的代理设置上。您可能需要在gradle.properties中进行以下设置(请根据您的代理设置进行修改):

systemProp.http.proxyHost=127.0.0.1
systemProp.http.proxyPort=8123
systemProp.https.proxyHost=127.0.0.1
systemProp.https.proxyPort=8123
ioekq8ef

ioekq8ef2#

我修复了它!!!!它不是由GFW引起的。当我在我的ubuntu上用Oracle-JDK替换OpenJDK时,它工作得很好!

相关问题