android build.gradleで混合バージョンを修正する方法は?(ライブラリはまったく同じバージョンを使用する必要があります)

オウサマ

Gradleの構成に問題があります。このエラーが発生します

All com.android.support libraries must use the exact same version specification (mixing versions can lead to runtime crashes). Found versions 28.0.0-alpha1, 27.1.1, 27.0.2. Examples include `com.android.support:animated-vector-drawable:28.0.0-alpha1` and `com.android.support:cardview-v7:27.1.1`

https://image.ibb.co/gwJ16n/Untitled.png「エラー」

この問題を解決するにはどうすればよいですか?

これが完全なbuil.gradle構成です。

apply plugin: 'com.android.application'

android {
    compileSdkVersion 27
    defaultConfig {
        applicationId "com.sakan"
        minSdkVersion 15
        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(dir: 'libs', include: ['*.jar'])
    implementation 'com.android.support:appcompat-v7:27.1.1'
    implementation 'com.android.support.constraint:constraint-layout:1.1.0'
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'com.android.support.test:runner:1.0.1'
    androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
    implementation 'com.android.support:design:27.1.1'
    implementation 'com.android.support:cardview-v7:27.1.1'
    implementation 'com.android.support:recyclerview-v7:27.1.1'
    implementation 'com.github.linger1216:labelview:v1.1.1'
    implementation 'com.github.ViksaaSkool:AwesomeSplash:v1.0.0'
    implementation 'com.nineoldandroids:library:2.4.0'
    implementation 'com.daimajia.easing:library:1.0.1@aar'
    implementation 'com.daimajia.androidanimations:library:1.1.3@aar'
    implementation 'com.android.support:multidex:1.0.3'
    implementation 'com.google.android.gms:play-services-maps:15.0.0'
    implementation 'com.google.android.gms:play-services-location:15.0.0'
    implementation 'com.facebook.android:facebook-android-sdk:4.32.0'
    implementation group:'com.squareup.picasso', name:'picasso', version:'2.5.0'
    implementation 'com.github.chenupt.android:springindicator:1.0.2@aar'
    implementation 'me.relex:circleindicator:1.2.2@aar'
    implementation 'com.txusballesteros:bubbles:1.2.1'
    implementation 'com.romainpiel.shimmer:library:1.4.0@aar'
    implementation 'tyrantgit:explosionfield:1.0.1'
    implementation 'com.github.ksoichiro:android-observablescrollview:1.5.0'
    implementation 'com.nineoldandroids:library:2.4.0'
    implementation 'com.github.bumptech.glide:glide:3.7.0'
    implementation 'com.google.android.gms:play-services-auth:15.0.0'
    implementation 'com.jakewharton:butterknife:7.0.1'
    implementation 'com.mcxiaoke.volley:library-aar:1.0.0'
    implementation 'com.loopj.android:android-async-http:1.4.9'
    implementation 'com.github.darsh2:MultipleImageSelect:v0.0.4'
    implementation 'com.facebook.android:facebook-android-sdk:4.32.0'
    implementation 'com.android.support.constraint:constraint-layout:1.1.0'
    implementation 'com.google.firebase:firebase-appindexing:15.0.0'
    implementation 'com.github.manuelpeinado.fadingactionbar:fadingactionbar:3.1.2'
    implementation 'com.github.manuelpeinado.fadingactionbar:fadingactionbar-abc:3.1.2'
}

依存関係の1つが別のターゲットバージョンを使用していると思いますが、この問題を修正する方法がわかりません。

オウサマ

これをbuild.gradle(Module:app)の最後に追加します。

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

    }
}

'27 .1.1 'を、すべての依存関係に使用するAndroidサポートライブラリのバージョンに置き換えてください。これは、complilesdkバージョンよりも低くすることはできません。

Gradleを再同期するより

私はこの答えを:ここで見つけまし

この記事はインターネットから収集されたものであり、転載の際にはソースを示してください。

侵害の場合は、連絡してください[email protected]

編集
0

コメントを追加

0

関連記事

Related 関連記事

ホットタグ

アーカイブ