0

I have downloaded jar file of Loopj library and placed it in libs folder. have tried many changes but getting same error. Can anyone please help me to solve this.

build.gradle :-

apply plugin: 'com.android.application'
android {
    compileSdkVersion 22
    buildToolsVersion "23.0.0"

    defaultConfig {
        applicationId "com.example.pratik.receivedsms"
        minSdkVersion 16
        targetSdkVersion 22
        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:22.2.0'

   compile 'com.jakewharton:butterknife:7.0.1'

    compile 'com.loopj.android:android-async-http:1.4.8'

}
8
  • Error:(32, 13) Failed to resolve: com.loopj.android:android-async-http:1.4.8 Show in File Show in Project Structure dialog</a> Commented Sep 16, 2015 at 8:23
  • Edit your question with whole error log from message tab in Android Studio.!! Commented Sep 16, 2015 at 8:24
  • I am getting error which i have mentioned in my heading "Failed to resolve:com.loopj.android:android-async-http:1.4.8" apart from that there is nothing in error log Commented Sep 16, 2015 at 8:33
  • I have added compile 'com.loopj.android:android-async-http:1.4.8' in my gradle and it works fine though. Clean and Rebuild your project..!! Commented Sep 16, 2015 at 8:35
  • solved Problem... Actually my offline mode was enabled that's why i was getting error. Thanks for giving your valuable time. :-) Commented Sep 16, 2015 at 8:46

1 Answer 1

1

What worked for me is opening gradle terminal from android studio and executing the following command:

    gradlew installarchives
  • It should also work without downloading the jar file.

  • Another note is that I am using version 1.4.5.

Good luck!

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.