如何在Android Studio中为Android模块添加Android依赖项?有没有比手动复制android.jar更简单的方法?
答案 0 :(得分:0)
您可以找到gradle版本并在build.gradle onder依赖项中设置它:
apply plugin: 'com.android.application'
android {
compileSdkVersion 25
buildToolsVersion "25.0.0"
defaultConfig {
applicationId "geert.berkers.cartracker"
minSdkVersion 14
targetSdkVersion 25
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
useLibrary 'org.apache.http.legacy'
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:25.0.0'
compile 'com.google.firebase:firebase-database:9.8.0'
compile 'com.android.support:design:25.0.0'
//Add it here!
}
apply plugin: 'com.google.gms.google-services'
答案 1 :(得分:0)
然后搜索并添加您的库。它会自动为项目和gradle文件添加依赖项。