找不到 com.android.support:support-v4:22.0.0.SDK更新后

找不到 com.android.support:support-v4:22.0.0.SDK更新后

问题描述:

sdk 更新后,我无法创建 hello world 应用程序.我的 build.gradle 看起来像这样

After the sdk update im not able to create a hello world application. My build.gradle looks like this

apply plugin: 'com.android.application'

android {
    compileSdkVersion 22
    buildToolsVersion "22.0.1"

    defaultConfig {
        applicationId "com.coders.yo"
        minSdkVersion 11
        targetSdkVersion 22
        versionCode 1
        versionName "1.0"
    }
    buildTypes {
        release {
            runProguard false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    compile 'com.android.support:appcompat-v7:22.0.0'
}

但是构建失败并显示

Error:A problem occurred configuring project ':app'.
> Could not resolve all dependencies for configuration ':app:_debugCompile'.
   > Could not find com.android.support:support-v4:22.0.0.
     Required by:
         Yo:app:unspecified > com.android.support:appcompat-v7:22.0.0

所以我添加了 compile 'com.android.support:support-v4:22.0.0.'现在我明白了

so i added compile 'com.android.support:support-v4:22.0.0.' and now i get

Error:Failed to find: com.android.support:support-v4:22.0.0.
<a href="openFile">Open File</a><br><a href="open.dependency.in.project.structure">Open in Project Structure dialog</a>

我已经更新了 android sdk和支持库

I have updated the android sdk and the support libraries

过去几个小时我一直被困在其中.有人可以帮我找出问题吗

I have been stuck in it for the past few hours .Can some one please help me identify the issue

您在 build.gradle 中的依赖项似乎是正确的.

Your dependencies in build.gradle seem to be correct.

尝试清理缓存(File -> Invalidate cache and restart),然后同步gradle文件并清理和构建.

Try to clean the cache (File -> Invalidate cache and restart), then sync the gradle file and clean and build.

在您的 gradle 文件中有一条奇怪的行.上一个 gradle 插件中不存在此 DSL(您使用的是哪个版本?)

In your gradle file there is a strange line. This DSL doesn't exist in last gradle plugin (which version are you using?)

 runProguard false

您应该更新插件(1.1.0),gradle版本(2.2.1)并在

You should update the plugin (1.1.0), the gradle version (2.2.1) and change this line in

minifyEnabled false