Не удалось разрешить: com.android.support:support-compat:27.2.0 - PullRequest
0 голосов
/ 07 мая 2018

У меня проблема с зависимостями в приложении 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' устарела и была заменена на 'реализация' и '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
}

Есть идеи, как это исправить? Заранее спасибо.

Ответы [ 2 ]

0 голосов
/ 07 мая 2018

Это потому, что вы использовали старую версию библиотеки 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'
}

синхронизировать ваш проект после изменения

0 голосов
/ 07 мая 2018

Все com.android.support должны использовать точно такую ​​же спецификацию версии

Вы используете animated-vector-drawable:27.1.1 в версии 27.1.1 и support-compat в версии 27.2.0. Вы должны сделать их той же версии.

...