This is a migrated thread and some comments may be shown as answers.

Failed to Resolve Error in Android Studio 1.1

2 Answers 323 Views
General Discussion
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Sal
Top achievements
Rank 1
Sal asked on 17 Feb 2015, 07:15 PM
So I followed the directions for adding the .aar files to the lib folder of my project and then updating my gradle file but I keep getting an error for all of the .aar files in Android Studio. The error just says "Failed to resolve: <aar file name>". Here is my current gradle file, I've been tinkering and tweaking it all morning based on other examples and posts online but I don't know if it's a problem with the current version of Android Studio or how I'm setting it up. 

buildscript {
    repositories {
        mavenCentral()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:1.0.1'
    }
}
 
apply plugin: 'com.android.application'
 
repositories {
    mavenCentral()
    flatDir {
        dirs 'libs'
    }
}
android {
 
    compileSdkVersion 21
    buildToolsVersion '21.1.2'
    defaultConfig {
        minSdkVersion 16
        targetSdkVersion 21
        versionCode 2
        versionName "1.6"
 
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
        }
    }
}
 
dependencies {
    compile 'com.google.android.gms:play-services:6.5.87'
    compile 'com.android.support:support-v4:21.0.3'
    compile 'com.android.support:appcompat-v7:21.0.3'
    compile files('src/main/libs/ksoap2-android-assembly-3.0.0-jar-with-dependencies.jar')
    compile files('src/main/libs/joda-time-2.3.jar')
    compile files('src/main/libs/gson-2.2.4.jar')
    compile files('src/main/libs/achartengine-1.2.0.jar')
    compile files('src/main/libs/ksoap2-android-assembly-3.3.0-jar-with-dependencies.jar')
    compile files('src/main/libs/pdfviewerlibrary.jar')
    compile(name:'Common-2014.3.1402-trial-release', ext:'aar')
    compile(name:'Primitives-2014.3.1402-trial-release', ext:'aar')
    compile(name:'Input-2014.3.1402-trial-release', ext:'aar')
    compile(name:'Chart-2014.3.1402-trial-release', ext:'aar')
    compile(name:'Feedback-2014.3.1402-trial-release', ext:'aar')
}

2 Answers, 1 is accepted

Sort by
0
Sal
Top achievements
Rank 1
answered on 17 Feb 2015, 07:53 PM
I may have found an alternate method for adding .aar files in Android Studio. First go to File -> New Module -> Import JAR or AAR Package. Then just pick the AAR file and it adds it's with no compile errors. 
0
Deyan
Telerik team
answered on 20 Feb 2015, 07:53 AM
Hi Sal,

Thanks for writing.

Good to know that you've managed to resolve your case. We will consider this thread closed for now.

Do not hesitate to write back in case you need further assistance.

Regards,
Deyan
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
Tags
General Discussion
Asked by
Sal
Top achievements
Rank 1
Answers by
Sal
Top achievements
Rank 1
Deyan
Telerik team
Share this question
or