问题出现在引用了别人分享到jcenter平台上的库,但缺少了在build.gradle里面配置,如下:
build.gradle配置:
repositories {
flatDir { dirs 'libs' }
}
dependencies {
compile fileTree(dir: 'libs', include: '*.jar')
compile 'com.squareup.retrofit:retrofit:1.8.0'
compile 'com.squareup.okhttp:okhttp-urlconnection:2.4.0'
compile 'com.google.code.gson:gson:2.4'
compile(name: 'xxx -sit-debug', ext: 'aar')
}
修复问题在repositories添加 jcenter()即可:
repositories {
jcenter()
flatDir { dirs 'libs' }
}
dependencies {
compile fileTree(dir: 'libs', include: '*.jar')
compile 'com.squareup.retrofit:retrofit:1.8.0'
compile 'com.squareup.okhttp:okhttp-urlconnection:2.4.0'
compile 'com.google.code.gson:gson:2.4'
compile(name: 'xxx -sit-debug', ext: 'aar')
}