今天想运行一下之前做的项目,结果报错:
ERROR: Unknown host 'repo.maven.apache.org: nodename nor servname provided, or not known'. You may need to adjust the proxy settings in Gradle.
Enable Gradle 'offline mode' and sync project
Learn about configuring HTTP proxies in Gradle
解决方式
build.gradle(Project: xxx),加上阿里镜像
// Top-level build file where you can add configuration options common to all sub-projects/modules. buildscript { repositories { maven{ url 'http://maven.aliyun.com/nexus/content/groups/public/'} // jcenter() google() mavenCentral() jcenter{url "http://jcenter.bintray.com/"} } dependencies { classpath 'com.android.tools.build:gradle:3.1.3' // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files } } allprojects { repositories { maven{ url 'http://maven.aliyun.com/nexus/content/groups/public/'} // jcenter() maven { url "https://jitpack.io" } google() mavenCentral() jcenter{url "http://jcenter.bintray.com/"} } } task clean(type: Delete) { delete rootProject.buildDir }
版权声明:本文为YuDBL原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接和本声明。