Android(安卓)studio 3.1.4 无法获取pom文件
16lz
2021-12-04
之前用Android studio一切正常,不过昨天下午突然报出这样的错误:Could not GET ‘https://dl.google.com/dl/android/maven2/com/android/tools/build/gradle/3.1.4/gradle-3.1.4.pom’.
试了很多办法,折腾了大半天终于让我给弄好了,具体办法如下:
1.File->Settings->Build,Execution,Deployment->Gradle->Android Studio,把这个对勾打上
现在重新试一下,如果好了就忽略下面的步骤
2.要是还不行那就在build.gradle中添加
maven { url ‘http://maven.aliyun.com/nexus/content/groups/public/’ }
添加之后如下所示:
// 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/' } google() jcenter() } dependencies { classpath 'com.android.tools.build:gradle:3.1.4' // 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/' } google() jcenter() }}task clean(type: Delete) { delete rootProject.buildDir}
现在再试一次,反正我是成功了,希望能帮到你。
更多相关文章
- 移动端H5的Video标签无法播放在线视频的问题
- 上官网学android之二(Building your First APP)
- checkbox 与 listview 等混用焦点问题
- Android与J2ME区别之我见(1)
- 为Android内核添加新驱动,并添加到menuconfig菜单
- Android(安卓)UI布局中设置了fill_parenet仍然没有全屏的解决办
- UI控件--ImageView和ImageButton
- Android(安卓)Activity四种加载方式
- 在Windows系统中使用NDK编译Android二进制文件并运行