4

I just installed Android Studio on elementary os 0.3.1 (based on Ubuntu 14.04 LTS), but I get the following error:

Error:(24, 13) Failed to resolve: com.android.support:appcompat-v7:15.+ 
Install Repository and sync project
Show in File
Show in Project Structure dialog

When I click on "Install Repository and sync project", I get this error:

Loading SDK information...
Ignoring unknown package filter 'extra-android-m2repository' 
Warning:The package filter removed all packages. There is nothing to install.
     Please consider trying to update again without a package filter.

My build.gradle (Module: app)

apply plugin: 'com.android.application'

android {
    compileSdkVersion 15
    buildToolsVersion "19.1.0"

    defaultConfig {
        applicationId "com.example.android.happybirthday"
        minSdkVersion 15
        targetSdkVersion 15
        versionCode 1
        versionName "1.0"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    testCompile 'junit:junit:4.12'
    compile 'com.android.support:appcompat-v7:15.+'
}

My build.gradle (Project: HappyBirthday)

// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
    repositories {
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:1.3.0'

        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        jcenter()
    }
}

task clean(type: Delete) {
    delete rootProject.buildDir
}
Magnus Teekivi
  • 473
  • 1
  • 7
  • 21
  • 2
    Please do not post error messages as images. They are harder to read, you can not copy paste from them and most important of all they make the question harder to find for other people with the same problem, since they are not searchable. – Anders Oct 02 '15 at 20:01

3 Answers3

1

From Android Studio go to: Tools >> Android >> SDK Manager Select and install "Extras|Android Support Repository"

If doesnt help, please post your gradle file.

João Menighin
  • 3,083
  • 6
  • 38
  • 80
1

try to install the option Android Support Library on the menu tools >> Android >> SDK Manager >> SDK Tools (tab).

Before that create a new project, that's worked for me.

Ramon Carvalho
  • 112
  • 1
  • 2
  • 11
1

Got same errors.

Mac OSX

V. 10.9.5

Android studio 1.4.1

build.gradle:

Before:
android { compileSdkVersion 15 buildToolsVersion "19.1.0"

After:
android { compileSdkVersion 23 buildToolsVersion "19.1.0"

Before:
dependencies { compile fileTree(dir: 'libs', include: ['*.jar']) testCompile 'junit:junit:4.12' compile 'com.android.support:appcompat-v7:15.+' }

After:
dependencies { compile fileTree(dir: 'libs', include: ['*.jar']) testCompile 'junit:junit:4.12' compile 'com.android.support:appcompat-v7:23.1.0' }


AndroidStudioProjects > 'app_name' > app > build.gradle

apply plugin: 'com.android.application'

android {
compileSdkVersion 23
buildToolsVersion "23.0.2"

defaultConfig {
    applicationId "com.example.johnkonderla.condor_paint"
    minSdkVersion 16
    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'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.1.0'
compile 'com.android.support:design:23.1.0'
}

Above changes + Build >> Clean Project.

Hope that helps!

BusinessFawn
  • 193
  • 3
  • 8