1

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.

MummyDing
  • 505
  • 1
  • 6
  • 17

3 Answers3

2

The problem may be your proxy settings. You may need to set the following in gradle.properties (please modify according to your proxy settings):

systemProp.http.proxyHost=127.0.0.1
systemProp.http.proxyPort=8123
systemProp.https.proxyHost=127.0.0.1
systemProp.https.proxyPort=8123
headuck
  • 2,763
  • 16
  • 19
  • Do you mean File->Settings->System Settings->Http Proxy ? If so,I checked "No proxy" option(Default Settings ). And I don't see any line like systemProp.http. in my gradle.properties. Moreover,I don't know how to "modify according to my proxy settings". I am sorry for that I have no knowledge with proxy. – MummyDing Sep 13 '15 at 10:15
  • And I simply add the lines:'systemProp.http.proxyHost=127.0.0.1 systemProp.http.proxyPort=8123 systemProp.https.proxyHost=127.0.0.1 systemProp.https.proxyPort=8123' ,but it didn't make any difference – MummyDing Sep 13 '15 at 10:20
  • Since you mentioned shadowsocks (and you can access google etc in browser?) you may already have some proxy setup in your browser. Please check if you have any proxy settings in your web browser configuration. – headuck Sep 13 '15 at 10:31
  • Not yet,I config it in my router,I don't need do anything in my PC.I can visit Google etc with my cell phone/PC if they connect to my wifi. – MummyDing Sep 13 '15 at 10:36
  • Perhaps you have a transparent proxy? Please comment out the lines you added in gradle.properties first. Just for sure, check if you set gradle to offline mode http://stackoverflow.com/questions/28493470/gradle-failed-to-resolve-library-in-android-studio – headuck Sep 13 '15 at 11:01
1

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

MummyDing
  • 505
  • 1
  • 6
  • 17
0

Please try this with sudo

dnf install python3-m2crypto

https://fedora.pkgs.org/35/fedora-x86_64/python3-m2crypto-0.38.0-2.fc35.x86_64.rpm.html

Amrit Raj
  • 39
  • 3