升级AndroidStudio3.0 Unable to resolve dependency for ':app@betaUnitTest/compileClasspath问题解决

AndroidStudio3.0升级报了下面的错误:

Error:Unable to resolve dependency for ':@debug/compileClasspath',Could not resolve project


造成这个错误的原因是app下build.gradle里面的buildtypes配置和module下build.gradle中的
buildtypes配置不一样。


下面是app下build.gradle里面的buildtypes配置

 buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
        sourceSets {
            main {
                jniLibs.srcDirs = ['libs']
                res.srcDirs =
                        [
                                'src/main/res/layout/viewpage',
                                'src/main/res/layout/recycler',
                                'src/main/res/layout/login',
                                'src/main/res'
                        ]
            }
        }
    }

包含release{} sourceSets{}两部分

再看自己工程里module下的build.gradle里面的buildtypes配置

  buildTypes {
        release {
            minifyEnabled false
        }
    }
缺少了sourceSets{}部分,module里面必须要也app中有同样的配置,写成空的也行,如下
  buildTypes {
        release {
            minifyEnabled false
        }
        sourceSets {

        }
    }


所以总结下来就是

app下build.gradle里面的buildtypes配置和module下
build.gradle中的buildtypes配置要一样。写成空的也行


Error:Unable to resolve dependency for ':app@debug/compileClasspath': Could not

12-03

我在更新android studio 之后 新建一个项目 出现如下错误:rnrnrnrnError:Unable to resolve dependency for ':app@debug/compileClasspath': Could not resolve com.android.support:appcompat-v7:26.1.0. Open FilernShow DetailsrnrnError:Unable to resolve dependency for ':app@debugAndroidTest/compileClasspath': Could not resolve com.android.support.test:runner:1.0.1. Open FilernShow DetailsrnrnError:Unable to resolve dependency for ':app@debugAndroidTest/compileClasspath': Could not resolve com.android.support.test.espresso:espresso-core:3.0.1. Open FilernShow DetailsrnrnError:Unable to resolve dependency for ':app@debugAndroidTest/compileClasspath': Could not resolve com.android.support:appcompat-v7:26.1.0. Open FilernShow DetailsrnrnError:Unable to resolve dependency for ':app@debugUnitTest/compileClasspath': Could not resolve com.android.support:appcompat-v7:26.1.0. Open FilernShow DetailsrnrnError:Unable to resolve dependency for ':app@release/compileClasspath': Could not resolve com.android.support:appcompat-v7:26.1.0. Open FilernShow DetailsrnrnError:Unable to resolve dependency for ':app@releaseUnitTest/compileClasspath': Could not resolve com.android.support:appcompat-v7:26.1.0. Open FilernShow Detailsrnrnwhen i click show detail this is the content :rnrnUnable to resolve dependency for ':app@debugUnitTest/compileClasspath': Could not resolve com.android.support:appcompat-v7:26.1.0.rnrnCould not resolve com.android.support:appcompat-v7:26.1.0. Required by: project :apprnrnCould not resolve com.android.support:appcompat-v7:26.1.0. Could not get resource 'https://dl.google.com/dl/android/maven2/com/android/support/appcompat-v7/26.1.0/appcompat-v7-26.1.0.pom'. Could not GET 'https://dl.google.com/dl/android/maven2/com/android/support/appcompat-v7/26.1.0/appcompat-v7-26.1.0.pom'. Connect to dl.google.com:443 [dl.google.com/74.125.237.0] failed: Connection timed out: connect Connection timed out: connectrnrnandroid studio 3.0.1 gradle4.1rn设置代理也不行 晕了 谁帮忙解决 直接40元红包走起rnrn鬼怪了

没有更多推荐了,返回首页