在 build.gradle
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
// You must install or update the Google Repository through the SDK manager to use this dependency.
// You must install or update the Support Repository through the SDK manager to use this dependency.
// You must install or update the Support Repository through the SDK manager to use this dependency.
oldCompile 'com.android.support:appcompat-v7:21.0.2'
compile 'com.google.android.gms:play-services:4.2.42'
compile 'com.squareup.retrofit:retrofit:1.6.1'
compile 'com.squareup.okhttp:okhttp:2.2.0' //updated this
compile 'com.squareup.okhttp:okhttp-urlconnection:2.2.0' //updated this
compile 'com.google.code.gson:gson:2.2.4'
compile 'com.squareup.picasso:picasso:2.5.0' //updated this
compile files('libs/robotium-solo-5.2.1.jar')
}
它既没有为我缓存图像,但是当我将 OkHttp、OkHttp-urlconnection、Picasso 更新到最新版本时,它就起作用了。尝试http://gradleplease.appspot.com以获取最新版本。