Не удалось разрешить: com.android.support:design:28.0 - PullRequest
0 голосов
/ 22 ноября 2018

Когда я наведите курсор мыши на 'com.android.support:appcompat-v7:28.0.0' в моем build.gradle, он говорит, что support libaries must use the exact same version specifications.Я получил эту ошибку из ниоткуда, после извлечения некоторых файлов из моего репо на github.Сначала я сослался на Все библиотеки com.android.support должны использовать точно такую ​​же спецификацию версий , где было опубликовано много решений, но после пробного использования многих из них я все еще не мог решить свою проблему.Я перечислю ниже шаги, которые я предпринял, чтобы попытаться решить проблему.Любая помощь будет здорово в этом.Я также опубликую свой build.gradle ниже.

steps taken to resolve issue

  1. Синхронизируйте проект с файлом Gradle
  2. Неправильные кэши и перезапустите
  3. Созданоновый проект и в основном скопировал в него все, что было связано с проблемами

Я также добавил следующий код в build.gradle, и он тоже не работал.

configurations.all {
    resolutionStrategy.eachDependency { 
 DependencyResolveDetails details ->
        def requested = details.requested
        if (requested.group == 
 'com.android.support') {
            if 
  (!requested.name.startsWith("multidex")) {
                details.useVersion '28.0.0'
             }
          }

        }
    }

build.gradle

apply plugin: 'com.android.application'

android {
    compileSdkVersion 28
    defaultConfig {
        applicationId "losdos.help4hire"
        minSdkVersion 21
        targetSdkVersion 28
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
        multiDexEnabled true
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
    packagingOptions {
        exclude 'META-INF/LICENSE'
        exclude 'META-INF/LICENSE-FIREBASE.txt'
        exclude 'META-INF/NOTICE'
    }
}

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation 'com.android.support:appcompat-v7:28.0.0'
    implementation 'com.android.support:design:28.0.0 '
    implementation 'com.android.support.constraint:constraint-layout:1.1.3'
    implementation 'com.google.android.gms:play-services-auth:12.0.1'
    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'
    implementation 'com.google.firebase:firebase-core:16.0.4'
    implementation 'com.google.firebase:firebase-database:16.0.3'
    implementation 'com.google.firebase:firebase-firestore:17.1.2'
    implementation 'com.android.support:multidex:1.0.3'
    implementation 'com.firebase:firebase-client-android:2.5.2+'
    implementation 'com.google.firebase:firebase-auth:16.0.5'
}

apply plugin: 'com.google.gms.google-services'

configurations.all {
    resolutionStrategy.eachDependency { DependencyResolveDetails details ->
        def requested = details.requested
        if (requested.group == 'com.android.support') {
            if (!requested.name.startsWith("multidex")) {
                details.useVersion '28.0.0 '
            }
        }

    }
}
Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...