1.连接超时
Error:Connection timed out: connect. If you are behind an HTTP proxy, please configure the proxy settings either in IDE or Gradle.
这个问题真的是遇到很多次了,很多git上面下载的项目都会遇到这个问题,起初的时候怀疑过自己的网络问题,电脑其实是有使用shadowsocks的,但是开了全局模式,编译还是同样的问题,搜了一下谷爹,在gradle.properties中添加如下代码
systemProp.http.proxyHost=127.0.0.1
systemProp.http.proxyPort=1087
systemProp.https.proxyHost=127.0.0.1
systemProp.https.proxyPort=1087
具体的端口配置按照你本地的来,我的是1087,默认应该是1080端口的
这样再次编译就可以了
2.ButterKnife jar包冲突
> com.android.build.api.transform.TransformException: java.util.zip.ZipException: duplicate entry: android/support/v4/hardware/display/DisplayManagerCompat$JellybeanMr1Impl.class
排查了所有的v4包最后发现是butterknife 8.6里面的问题,去除一下就可以了
compile('com.jakewharton:butterknife:8.6.0'){
exclude module: 'support-compat'
}