开发中遇到的Gradle,kotlin插件,AS无法更新或者网络超时问题

本文提供了解决Kotlin版本不一致的两种方法:调整kotlin_version至本地版本,以及添加mavenCentral()库以解决google()库访问问题。同时,针对Android Studio更新失败的情况,建议检查并恢复hosts文件至原始状态,以避免网络超时。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

1.编译版本不一致

解决办法:

2.Kotlin version that is used for building with Gradle (1.1.51) differs from the one bundled into the IDE plugin (1.2.41) less...

kotlin 版本不一致但是sync 又 runtime out

解决方法:1.第一个是修改 kotlin_version版本为你本地有的版本

                  2.google()库访问不了,添加mvenCnetral()库

 3.android studio 更新不了

一方面是网络原因,另一个原因就是你的hosts修改过,导致update网络超时

解决办法:把你的hosts恢复为原来的,再重启as

下面附上windows hosts文件

 # copyright (c) 1993-1999 microsoft corp.
#
# this is a sample hosts file used by microsoft tcp/ip for windows.
# this file contains the mappings of ip addresses to host names. each
# entry should be kept on an individual line. the ip address should
# be placed in the first column followed by the corresponding host name.
# the ip address and the host name should be separated by at least one
# space.
#
# additionally, comments (such as these) may be inserted on individual
# lines or following the machine name denoted by a '#' symbol.
#
# for example:
#
# 102.54.94.97 rhino.acme.com # source server
# 38.25.63.10 x.acme.com # x client host
127.0.0.1 localhost
127.0.0.1 localhost

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值