请帮助解决这个错误,因为这是我的第一个 android 项目! Gradle 同步: 应用插件:'com.android.application'
android {
compileSdkVersion 8
buildToolsVersion "23.0.2"
defaultConfig {
applicationId "com.example.interceptor.myapplication"
minSdkVersion 5
targetSdkVersion 8
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:8.0.+'
}
在 Gradle 控制台上我得到: 失败:构建失败,出现异常。
出了什么问题: 配置项目“:app”时出现问题。
Could not resolve all dependencies for configuration ':app:_debugCompile'. Could not find any version that matches com.android.support:appcompat-v7:8.0.+. Versions that do not match: 24.0.0-alpha1 23.2.1 23.2.0 23.1.1 23.1.0 + 14 more 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:/Users/INTERCEPTOR/AppData/Local/Android/sdk/extras/android/m2repository/com/android/support/appcompat-v7/maven-metadata.xml file:/D:/Users/INTERCEPTOR/AppData/Local/Android/sdk/extras/google/m2repository/com/android/support/appcompat-v7/maven-metadata.xml file:/D:/Users/INTERCEPTOR/AppData/Local/Android/sdk/extras/google/m2repository/com/android/support/appcompat-v7/ Required by: MyApplication:app:unspecified
尝试: 使用 --stacktrace 选项运行以获取堆栈跟踪。使用 --info 或 --debug 选项运行以获得更多日志输出。
构建失败
最佳答案
您应该为 appcompat-v7
依赖项使用正确的版本。
目前上述依赖的最新稳定版本是:
compile 'com.android.support:appcompat-v7:23.2.1'
如上所述使用它,并确保您之前在 SDK Manager 中安装/更新到最新版本。
关于android - 错误 :(24, 11) 无法解析 : com. android.support :appcompat-v7:8. 0.+,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35960303/