无法解决android studio中的问题

时间:2017-02-02 10:16:40

标签: android android-studio

我在一家公司使用Android Studio进行Android开发,而且当我使用gradle添加任何依赖时,我在每个gradle依赖项上都会出现“Failed to resolved”错误。请告诉我这背后的问题是什么。

谢谢。

  

错误:(24,13)无法解决:com.android.volley:volley:1.0.0 Show   在文件中显示   项目结构对话框

apply plugin: 'com.android.application'

android {
    compileSdkVersion 25
    buildToolsVersion "25.0.1"
    defaultConfig {
        applicationId "calkinsmedia.com.myapplication"
        minSdkVersion 15
        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'])
    compile 'com.android.support:appcompat-v7:25.1.0'
    compile 'com.android.volley:volley:1.0.0'
}

这是我的项目级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.2'

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

1 个答案:

答案 0 :(得分:1)

是的,我找到了解决方案。问题是什么,在我的系统中有一个防病毒软件会阻止android工作室下载依赖项。一旦我关闭了防病毒软件,一切正常。