gpt4 book ai didi

android - 无法解析 : com. android.support :support-compat:27. 2.0

转载 作者:搜寻专家 更新时间:2023-11-01 08:21:49 25 4
gpt4 key购买 nike

我的 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

和:

enter image description here

我还得到:配置“compile”已过时,已被“implementation”和“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
}

知道如何解决这个问题吗?提前致谢。

最佳答案

是因为你使用了老版本的appcompat库即:

implementation 'com.android.support:appcompat-v7:25.1.1'

将它的版本从 v7:25.1.1 更改为 27.1.1

例子:

dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation 'com.android.support:appcompat-v7:27.1.1'
implementation 'com.android.support:animated-vector-drawable:27.1.1'
implementation 'com.android.support:support-compat:27.1.1'
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'
}

更改后同步您的项目

关于android - 无法解析 : com. android.support :support-compat:27. 2.0,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50216846/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com