打开 Android Studio 的旧应用程序时出现一些错误
ERROR: In project 'app' a resolved Google Play services library dependency depends on another at an exact version (e.g. "[15.0.1]", but isn't being resolved to that version. Behavior exhibited by the library will be unknown.
Dependency failing: com.google.android.gms:play-services-flags:15.0.1 -> com.google.android.gms:play-services-basement@[15.0.1], but play-services-basement version was 16.0.1.
The following dependencies are project dependencies that are direct or have transitive dependencies that lead to the artifact with the issue.
-- Project 'app' depends onto com.google.firebase:firebase-analytics-impl@{strictly 16.1.1}
-- Project 'app' depends onto com.google.firebase:firebase-auth-interop@{strictly 16.0.0}
-- Project 'app' depends onto com.google.firebase:firebase-core@16.0.1
-- Project 'app' depends onto com.google.android.gms:play-services-tasks@{strictly 16.0.1}
-- Project 'app' depends onto com.google.firebase:firebase-core@{strictly 16.0.1}
-- Project 'app' depends onto com.google.firebase:firebase-analytics@{strictly 16.0.1}
-- Project 'app' depends onto com.google.android.gms:play-services-basement@{strictly 16.0.1}
-- Project 'app' depends onto com.google.firebase:firebase-auth@{strictly 16.0.1}
-- Project 'app' depends onto com.google.firebase:firebase-database-collection@{strictly 16.0.0}
-- Project 'app' depends onto com.google.firebase:firebase-database@{strictly 16.0.4}
-- Project 'app' depends onto com.google.android.gms:play-services-base@{strictly 16.0.1}
-- Project 'app' depends onto com.google.firebase:firebase-iid@{strictly 16.0.0}
-- Project 'app' depends onto com.google.firebase:firebase-database@16.0.4
-- Project 'app' depends onto com.google.firebase:firebase-common@{strictly 16.0.3}
-- Project 'app' depends onto com.google.firebase:firebase-auth@16.0.1
-- Project 'app' depends onto com.google.firebase:firebase-measurement-connector-impl@{strictly 16.0.1}
-- Project 'app' depends onto com.google.android.gms:play-services-stats@{strictly 15.0.1}
-- Project 'app' depends onto com.google.firebase:firebase-measurement-connector@{strictly 16.0.0}
-- Project 'app' depends onto com.google.firebase:firebase-iid-interop@{strictly 16.0.0}
-- Project 'app' depends onto com.google.android.gms:play-services-ads-identifier@{strictly 15.0.1}
-- Project 'app' depends onto com.google.android.gms:play-services-flags@{strictly 15.0.1}
For extended debugging info execute Gradle from the command line with ./gradlew --info :app:assembleDebug to see the dep
endency paths to the artifact. This error message came from the google-services Gradle plugin, report issues at https://
github.com/google/play-services-plugins and disable by adding "googleServices { disableVersionCheck = false }" to your build.gradle file.
构建.gradle:
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.4.0'
classpath 'com.google.gms:google-services:4.2.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
模块构建.gradle:
implementation "com.airbnb.android:lottie:2.1.0"
implementation "com.google.firebase:firebase-auth:16.0.1"
//implementation 'com.google.firebase:firebase-database:16.0.3'
implementation 'com.android.support:support-v4:28.0.0'
implementation 'com.google.firebase:firebase-database:16.0.4'
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'
更改应用程序 build.gradle 以使用 gms 版本 15.0.1。
implementation "com.airbnb.android:lottie:2.1.0"
implementation "com.google.firebase:firebase-auth:15.0.1"
//implementation 'com.google.firebase:firebase-database:16.0.3'
implementation 'com.android.support:support-v4:28.0.0'
implementation 'com.google.firebase:firebase-database:16.0.4'
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:15.0.1'
我是一名优秀的程序员,十分优秀!