Install Failed. Please check your network connection and try again.
2018-03-16 14:30
866 查看
1、当我们在SDK的tool里面下载更新时,出现了下面的问题:
![](https://oscdn.geek-share.com/Uploads/Images/Content/202006/01/ef5d2da792d225c482aa62bae16ef104)
解决的方法很简单,在跟项目的build.gradle里面加入google(),比如下面这样:
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.0.1'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
google()
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
} 2、但是关于as版本过低会出现上面的问题,就是说低版本as没有google()库,会出现这个问题:Could not find method google() for arguments [] on repository container.
解决的方法就是把google()换成
解决的方法很简单,在跟项目的build.gradle里面加入google(),比如下面这样:
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.0.1'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
google()
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
} 2、但是关于as版本过低会出现上面的问题,就是说低版本as没有google()库,会出现这个问题:
Could not find method google() for arguments [] on repository container.
解决的方法就是把google()换成maven{url 'https://maven.google.com'}
解决!
相关文章推荐
- Mac OS中, android stuido升级提示Connection failed. Please check your network connection and try again
- android studio升级时提示 Connection failed. Please check your network connection and try again
- Android Studio:Connection failed. Please check your network connection and try again
- android studio升级时提示 Connection failed. Please check your network connection and try again
- Failed to download samples index, please check your connection and try again 解决
- Failed to download samples index, please check your connection and try again
- Studio 更新的时候提示Connection failed (connect timed out). Please check network connection and try again.
- Connection failed(connect timed out).Please check network connection and try again
- Failed to download samples index, please check your connection and try again 解决
- Android Studio 1.2正式版发布,要如何更新? Please check network connection and try again.
- AndroidStudio升级报错:Connection failed (connect timed out). Please check network connection and try ...
- Failed to export using the options you specified. Please check your options and try again
- 解决:Please check your setup and try again. (0xE8000022).
- 运行JFinal时jdk报错:A JNI error has occurred,please check your installation and try again
- Xcode Please check your setup and try again
- Gradle project sync failed. Please fix your project and try again
- Mac android studio升级时提示 :Connection failed. Please check your network connection .
- 解决Gradle project sync failed. Please fix your project and try again.
- Android Studio 1.3/1.4 无法更新下载Android NDK:install failed please check your network