赞
踩
问题1: Android Studio 编译时报错:“Could not resolve all files for configuration ‘:app:debugRuntimeClasspath‘.”
原因: Android Studio经常出现dependencies或者configuing相关错误,这类错误出现的原因一般是Android Gradle Plugin Version、Gradle Version版本与工程文件冲突。
解决方法: 更改合适的Android Gradle Plugin Version和Gradle Version版本。
操作: File - Project Structure - Project (图中显示的两个版本是测试没问题的)
问题2 按照上述方法修改版本后,需要下载新的gradle,会报错:Unknown host ‘不知道这样的主机。 (dl.google.com)’.You may need to adjust the proxy settings in Gradle. 用外网下载时报超时的问题
原因: 找了很多资料,基本原因是代理的问题。
解决方法: 在其他地方找了添加代理的相关方法都不顶用之后,可以在Android Studio中把代理关掉(No proxy)。然后在 hosts 文件中添加:203.208.40.36 dl.google.com 后保存文件,最后再Android Studio上重新同步并编译。
hosts 文件路径: C:\Windows\System32\drivers\etc\hosts
添加的内容: 203.208.40.36 dl.google.com
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。