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
}
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.
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
Above changes + Build >> Clean Project.
Hope that helps!
From Android Studio go to: Tools >> Android >> SDK Manager Select and install "Extras|Android Support Repository"
If doesnt help, please post your gradle file.