首先,你在运行的时候,会爆dex包冲突
第一时间是去检查,有哪些包冲突
这里会列出你所使用的所有jar包
然后你可以很清晰的看出,哪些包是重复了,版本不统一
楼主本次遇到的问题是gson以及okhttp包冲突
最后使用exclude方式解决
compile('com.squareup.retrofit2:retrofit:2.1.0') { exclude group: 'com.squareup.okhttp3' } compile('com.squareup.retrofit2:converter-gson:2.1.0') { exclude group: 'com.google.code.gson' exclude group: 'com.squareup.okhttp3' }问题完美解决