studio3.1.1关于Error:Unable to resolve dependency 的解决方案

上课的时候死活解决不了,然后老师过来帮我一鼓捣就好了。。。记下来老师的解决方法,便于以后再出错自己自行解决

我的错误:

Possible causes:<ul><li>The project ‘XXXXXXX' may be using a version of Gradle that does not containPossible causes:<ul><li>The project ‘XXXXXXX' may be using a version of Gradle that does not contain the method.
<a href="open.wrapper.file">Open Gradle wrapper file</a></li><li>The <a href="apply.gradle.plugin">Apply Gradle plugin</a></li>

 the method.
<a href="open.wrapper.file">Open Gradle wrapper file</a></li><li>The build file may be missing a Gradle plugin.
<a href="apply.gradle.plugin">Apply Gradle plugin</a></li>

 

或者类似这样的错误,我之前的解决方法是,复制一份之前的gradle的dependencies

dependencies {
    implementation fileTree(include: ['*.jar'], dir: 'libs')
    implementation 'com.android.support:appcompat-v7:26.1.0'
    implementation 'com.android.support.constraint:constraint-layout:1.0.2'
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'com.android.support.test:runner:1.0.1'
    androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'

}


但是recyclerview始终报错。。

老师说我出现问题的原因是下载了新的Android Studio后因为被墙没有下成功对应的gradle。。

解决方法就是科学上网以后,打开settings,搜索HTTP proxy


将此时HTTP(S)代理服务器的码填入Host nameport number中,再build一下,等到编译成功后再切换到no proxy就好


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鬼怪了

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

私密
私密原因:
请选择设置私密原因
  • 广告
  • 抄袭
  • 版权
  • 政治
  • 色情
  • 无意义
  • 其他
其他原因:
120
出错啦
系统繁忙,请稍后再试

关闭