com.android.support:appcompat-v7:21.+.

//错误信息

1.Error:A problem occurred configuring project ':app'.

> Could not resolve all dependencies for configuration ':app:_debugCompile'.

   > Could not find any version that matches com.android.support:appcompat-v7:22.+.

     Searched in the following locations:

         https://jcenter.bintray.com/com/android/support/appcompat-v7/maven-metadata.xml

         https://jcenter.bintray.com/com/android/support/appcompat-v7/

         file:/D:/Android/sdk/extras/android/m2repository/com/android/support/appcompat-v7/maven-metadata.xml

         file:/D:/Android/sdk/extras/google/m2repository/com/android/support/appcompat-v7/maven-metadata.xml

         file:/D:/Android/sdk/extras/google/m2repository/com/android/support/appcompat-v7/

     Required by:

         MyApplication:app:unspecified

2.Error:Failed to find: com.android.support:appcompat-v7:22.+

<a href="openFile">Open File</a><br><a href="open.dependency.in.project.structure">Open in Project Structure dialog</a>


=============================================================================

//解决方法

//app 的build.gradle里代码如下

apply plugin: 'com.android.application'

android {

    compileSdkVersion 21

    buildToolsVersion '21.1.2'

  //要和SDK  Manager里的build-tools一致

    defaultConfig {

        applicationId "com.example.dongzhe.zlqhapp"

        minSdkVersion 15

        targetSdkVersion 21

        versionCode 1

        versionName "1.0"

    }

    buildTypes {

        release {

            minifyEnabled false

            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'

        }

    }

    packagingOptions {

        exclude 'META-INF/LICENSE'

        exclude 'META-INF/NOTICE'

        exclude 'META-INF/LICENSE.txt'

        exclude 'META-INF/NOTICE.txt'

    }

    productFlavors {

    }

}

dependencies {

    compile fileTree(include: ['*.jar'], dir: 'libs')

    compile files('libs/commons-logging-1.1.1.jar')

    compile files('libs/commons-codec-1.10.jar')

    compile 'com.android.support:appcompat-v7:21.0.3'

    //要和SDK  Manager/extras/android/m2repository/com/android/support/appcompat-v7中的版本一致

}



评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值