【问题标题】:App level gradle sync failed after following steps for connecting to firebase遵循连接到 Firebase 的步骤后,应用程序级别的 gradle 同步失败
【发布时间】:2018-10-19 06:05:25
【问题描述】:
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.3'
 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.1'
}

导致错误:

implementation 'com.android.support:appcompat-v7:27.1.1'
same version specification (mixing versions can lead to runtime crashes)
says "All com.android.support libraries must use the exact same version specification (mixing versions can lead to runtime crashes). Found versions 27.1.1, 26.1.0. Examples include com.android.support:animated-vector-drawable:27.1.1 and com.android.support:support-media-compat:26.1.0"

【问题讨论】:

    标签: android firebase android-studio


    【解决方案1】:

    你必须在依赖块之后添加这个

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

    它会消除这个错误!!

    【讨论】:

      猜你喜欢
      • 2019-01-22
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多