无法解决:com.android.support:appcompat-v7.15

时间:2015-10-02 19:50:27

标签: android ubuntu

我刚刚在基本操作系统0.3.1上安装了Android Studio(基于Ubuntu 14.04 LTS),但是我收到以下错误:

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

当我点击“安装存储库并同步项目”时,我收到此错误:

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.

我的build.gradle(模块: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.+'
}

我的build.gradle(项目: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
}

3 个答案:

答案 0 :(得分:1)

从Android Studio转到:工具>> Android>> SDK Manager 选择并安装“Extras | Android Support Repository”

如果没有帮助,请发布您的gradle文件。

答案 1 :(得分:1)

尝试在菜单工具>>上安装Android支持库选项Android>> SDK Manager>> SDK工具(标签)。

在此之前创建一个新项目,这对我有用。

答案 2 :(得分:1)

得到同样的错误。

Mac OSX

诉10.9.5

Android studio 1.4.1

的build.gradle:

之前:
android {compileSdkVersion 15 buildToolsVersion“19.1.0”

之后:
android {compileSdkVersion 23 buildToolsVersion“19.1.0”

之前:
依赖项{compile fileTree(dir:'libs',include:['* .jar'])testCompile'junit:junit:4.12'compile'c​​om.android.support:appcompat-v7: 15. +'}

之后:
依赖关系{compile fileTree(dir:'libs',include:['* .jar'])testCompile'junit:junit:4.12'compile'c​​om.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'
}

以上更改+构建>>清洁项目。

希望有所帮助!