记得上一次配置gson包的时候是按照(http://blog.youkuaiyun.com/oqihaogongyuan/article/details/50944755)这篇说的,去搜索gson,然后就出来最新版的包,这样app的gradle文件中就会自动生成compile内容,可是换了一台电脑死活搜索不出来。于是发现了以下方法:
1、去meaven官网搜索gson包:http://mvnrepository.com/artifact/com.google.code.gson/gson/2.8.2 (这个是我点进了我下的时候最新的包的页面)
2、点击gradle,下面对应出现了两行:
// https://mvnrepository.com/artifact/com.google.code.gson/gson
compile group: 'com.google.code.gson', name: 'gson', version: '2.8.2'
3、复制以上内容放到项目gradle(app)文件的dependencies {}中,我是加在了最后
4、这个时候,studio就自己开始gradlling\自己下载gson包了
于是就搞定了,在External Libraries里面也能看到gson包啦~