//错误信息
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中的版本一致
}