Android studio 解析com.android.support失败。浓缩咖啡:浓缩咖啡核心:2.2.2

Android studio 解析com.android.support失败。浓缩咖啡:浓缩咖啡核心:2.2.2,android-studio,compiler-errors,android-gradle-plugin,Android Studio,Compiler Errors,Android Gradle Plugin,我刚刚第一次下载了android studio,我发现了gradle错误。我已经下载了SDK提供的所有内容,仍然存在相同的错误 apply plugin: 'com.android.application' android { compileSdkVersion 25 buildToolsVersion "25.0.2" defaultConfig { applicationId "com.example.noelly.myapplication" minSdkVersion

我刚刚第一次下载了android studio,我发现了gradle错误。我已经下载了SDK提供的所有内容,仍然存在相同的错误

apply plugin: 'com.android.application'

android {
compileSdkVersion 25
buildToolsVersion "25.0.2"
defaultConfig {
    applicationId "com.example.noelly.myapplication"
    minSdkVersion 19
    targetSdkVersion 25
    versionCode 1
    versionName "1.0"
    testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
    }
}
}

dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
    exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.support:appcompat-v7:25.+'
testCompile 'junit:junit:4.12'
}
我得到的错误是

  (Failed to resolve: com.android.support.appcompat-v7:25.+)

顺便说一句,一切都是最新的,请帮助这是真正令人沮丧的开始

**从答案一编辑-已安装工具的图片---

代码表单project build.gradle

// 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:2.2.3'

    // 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
}

新的错误消息\uuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuu

apply plugin: 'com.android.application'

android {
compileSdkVersion 25
buildToolsVersion "25.0.2"
defaultConfig {
    applicationId "com.example.noelly.myapplication"
    minSdkVersion 19
    targetSdkVersion 25
    versionCode 1
    versionName "1.0"
}
buildTypes {
    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
    }
}
}

dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:25.1.0'
}
更新: 您下载的SDK一定有问题。导航到C:/Users/Noelly/AppData/Local/Android/Sdk/extras/Android/m2repository/com/Android并删除
support
文件夹


现在打开SDK管理器,重新安装Android支持存储库。

重命名布局文件后,我收到了相同的错误消息,尽管之前一切都正常。我通过评论gradle的以下几行来解决这个问题:

androidTestCompile('com.android.support.detail_layout.espresso:espresso-core:2.2.2', {
        exclude group: 'com.android.support', module: 'support-annotations'
    }) 

我不知道为什么会发生这种情况,也不知道这是否是一种很好的解决方法,只希望这对像我这样的初学者来说是一种快速的解决方法。

我遇到了和你一样的问题,我已经找到了解决问题的方法。 这是因为我使用的是x86操作系统,而android studio是x64。 我转到并按下“下载选项”,安装了x86版本的android studio。 不要卸载以前的x64 android studio。它是必需的,因为android sdk。 在任何地方解压x86 android studio,并找到“bin”文件夹。应该有你的“studio.exe”

解析com.android.support失败。浓缩咖啡:浓缩咖啡核心:2.2.2

重构布局名称时可能会发生此错误

我也有同样的问题,我的错误是我创建了布局命名test.xml,然后当我用likelayout\u offers.xml重构该名称时,我的gradle被更改为



而它应该像follow一样

dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
    exclude group: 'com.android.support', module: 'support-annotations'
})

因此,一个解决方案是,我们应该避免使用test.xml作为布局名称。

您真的需要这些测试库吗?(espresso和junit)如果我删除它们,我会收到更多错误。你确定你下载了Android支持库SDK吗?您可以发布Android SDK管理器的屏幕截图,显示已安装的工具吗?我在原始postMaybe的底部发布了一个指向屏幕截图-^的链接,您应该指定完整的版本号'com.Android.support:appcompat-v7:25.1.0'Iv'e已尝试,它将错误消息替换为我编辑的版本。
dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    androidTestCompile('com.android.support.detail_layout.espresso:espresso-core:2.2.2', {
        exclude group: 'com.android.support', module: 'support-annotations'
    })
    })
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
    exclude group: 'com.android.support', module: 'support-annotations'
})