报错信息:
ERROR: Unable to resolve dependency for ':[email protected]/compileClasspath': Could not download gson.jar (com.google.code.gson:gson:2.8.6)
Show Details
Affected Modules: app
方法一:选中NO proxy
方法二:注释掉gradel.properties中的代理代码。
方法三:Cache/Restart。
- Go to "File".
- Click on Invalidate Cache/ Restart.
- Again click on Invalidate Cache / Restart(On dialoge window).
方法四:将前面一个修改为后面一个
implementation fileTree(include: ['*.jar'])
to
// implementation or compile
implementation fileTree(include: ['*.jar'], dir: 'libs')
方法五:在build.gradle (app)中增加如下,
dexOptions { // release & debug is in project animators matchingFallbacks = ['release', 'debug'] } debug { }
方法六:是否版本问题,切换其它版本试下。(成功解决我的问题)。
将gson最新的2.8.6修改为2.7则成功。
参考文章:
https://blog.csdn.net/leol_2/article/details/84785626
https://www.cnblogs.com/yuyuan-bb/p/11562054.html