Failed to Resolve Error in Android Studio 1.1

3 posts, 0 answers
  1. Sal
    Sal avatar
    58 posts
    Member since:
    Feb 2015

    Posted 17 Feb 2015 Link to this post

    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. Sal
    Sal avatar
    58 posts
    Member since:
    Feb 2015

    Posted 17 Feb 2015 in reply to Sal Link to this post

    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. 
  3. DevCraft banner
  4. Deyan
    Admin
    Deyan avatar
    2037 posts

    Posted 20 Feb 2015 Link to this post

    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.

     
Back to Top