【发布时间】:2018-10-17 09:58:42
【问题描述】:
我的 App gradle 中的依赖项有问题:
apply plugin: 'com.android.application'
android {
compileSdkVersion 27
defaultConfig {
applicationId "fr.android.MyApp"
minSdkVersion 16
targetSdkVersion 27
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation 'com.android.support:appcompat-v7:25.1.1'
implementation 'com.android.support:animated-vector-drawable:27.1.1'
implementation 'com.android.support:support-compat:27.2.0'
implementation 'com.android.support.constraint:constraint-layout:1.1.0'
implementation 'com.google.firebase:firebase-auth:11.6.0'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso- core:3.0.2'
}
apply plugin: 'com.google.gms.google-services'
出错的行是:
implementation 'com.android.support:animated-vector-drawable:27.1.1'
它说:无法解决:com.android.support:animated-vector-drawable:27.1.1
还有:
我还得到:配置“编译”已过时,已替换为“实现”和“API”。 它将在 2018 年底被删除。
这是我的 build.gradle :
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.1.2'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
classpath 'com.google.gms:google-services:3.1.1'
}
}
allprojects {
repositories {
google()
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
关于如何解决这个问题的任何想法?提前致谢。
【问题讨论】:
标签: android android-studio android-gradle-plugin dependencies build.gradle