如何新增依賴項
下面的示例描述瞭如何在 app / module 的 build.gradle
檔案中宣告三種不同型別的直接依賴項:
android {...}
...
dependencies {
// The 'compile' configuration tells Gradle to add the dependency to the
// compilation classpath and include it in the final package.
// Dependency on the "mylibrary" module from this project
compile project(":mylibrary")
// Remote binary dependency
compile 'com.android.support:appcompat-v7:24.1.0'
// Local binary dependency
compile fileTree(dir: 'libs', include: ['*.jar'])
}