10.11添加代码仓库依赖

 添加代码仓库的依赖

这种方式最简单直接在项目module的build.gradle 里面的dependencies 里添加一句话,然后重新构建即可,如:

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    testCompile 'junit:junit:4.12'
    compile 'com.android.support:appcompat-v7:23.3.0'
    compile 'com.android.support:design:23.3.0'
    //添加了OKHttp的依赖
    compile 'com.squareup.okhttp3:okhttp:3.2.0'
}
 

 可以手动添加也可以右键项目在open module settings里搜索添加(推荐这种方式)

原文地址:https://www.cnblogs.com/zhaoyids/p/14867061.html