android - 错误 :(24, 11) 无法解析 : com. android.support :appcompat-v7:8. 0.+

标签 android sdk

请帮助解决这个错误,因为这是我的第一个 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/

相关文章:

android - 显示以设置在 SwitchCompat 处于关闭状态时可见的文本?

java - 我忘记了哪个库?

android - 如何在没有用户交互的情况下停止重复 android ViewFlipper 幻灯片?

iphone - 程序员之间是否可以共享 Apple Developer Program 许可证?

javascript - JavaScript Azure SDK 中的 DefaultAzureCredential、InteractiveBrowserCredential 等由于未找到 child_process,在编译时会引发错误

android - Corona SDK 允许设备音量控制

android - 不推荐使用配置 'compile',但所有配置都是 'implementation'

java - 如何在Android中在 Canvas 上的线下绘制自定义阴影

android - 使用 Apache Flex SDK4.8.0、AIR3.4 和 FDT5.6.2 编译生成 "unable to open ' {airHome}/frameworks/libs/air/airglobal.swc'"

architecture - 框架与 SDK