Java Gradle要求将一些版本的库放在17.0.3中

Java Gradle要求将一些版本的库放在17.0.3中,java,android,Java,Android,Gradle要求将库版本更改为17.0.3,但此更改会导致更多错误 我试图更改所有版本,但错误保持不变。更改了com.google.gms本身的版本:谷歌服务 dependencies { implementation 'com.google.android.gms:play-services-gcm:15.0.0' implementation 'com.onesignal:OneSignal:[3.9.1, 3.99.99]' implementation 'com.

Gradle要求将库版本更改为17.0.3,但此更改会导致更多错误

我试图更改所有版本,但错误保持不变。更改了com.google.gms本身的版本:谷歌服务

dependencies {
    implementation 'com.google.android.gms:play-services-gcm:15.0.0'
    implementation 'com.onesignal:OneSignal:[3.9.1, 3.99.99]'
    implementation 'com.android.support.constraint:constraint-layout:1.0.2'
    implementation 'com.google.firebase:firebase-ads:10.2.0'
    implementation 'com.google.firebase:firebase-database:15.0.1'
    implementation 'com.google.firebase:firebase-core'
    implementation fileTree(include: ['*.jar'], dir: 'libs')
    //noinspection GradleCompatible
    implementation 'com.android.support:support-v4:26.1.0'
    androidTestImplementation('com.android.support.test.espresso:espresso-core:2.2.2', {
        exclude group: 'com.android.support', module: 'support-annotations'
    })
    //noinspection GradleCompatible
    implementation 'com.android.support:appcompat-v7:26.1.0'
    implementation 'com.android.support:design:28.0.0'
    implementation 'com.intuit.sdp:sdp-android:1.0.4'
    implementation 'com.github.bmarrdev:android-DecoView-charting:v1.2'
    implementation 'jp.wasabeef:recyclerview-animators:2.2.5'
    implementation 'com.android.support:recyclerview-v7:28.0.0'
    implementation 'me.itangqi.waveloadingview:library:0.3.5'
    implementation 'com.wang.avi:library:2.1.3'
    implementation 'tyrantgit:explosionfield:1.0.1'
    implementation 'com.zys:brokenview:1.0.3'
    implementation 'com.startapp:inapp-sdk:3.9.3'
    implementation 'com.android.support:cardview-v7:28.0.0'
    implementation 'net.grandcentrix.tray:tray:0.12.0'
    implementation 'com.github.ybq:Android-SpinKit:1.2.0'
    implementation 'com.skyfishjy.ripplebackground:library:1.0.1'
    implementation 'com.google.android.gms:play-services-ads:15.0.1'
    implementation 'com.yandex.android:mobmetricalib:3.0.0'
    implementation 'com.hudomju:swipe-to-dismiss-undo:1.0'
    implementation 'com.android.support:recyclerview-v7:28.0.0'
    // Facebook sdk
    implementation 'com.facebook.android:facebook-core:[4,5)'
    implementation 'com.facebook.android:facebook-applinks:[4,5)'
    testImplementation 'junit:junit:4.12'
    implementation 'com.google.android.gms:play-services-analytics:10.2.4'
    implementation('com.crashlytics.sdk.android:crashlytics:2.9.5@aar') {
        transitive = true
    }
    implementation('com.crashlytics.sdk.android:answers:1.4.1@aar') {
        transitive = true
    }
}



ERROR: Failed to resolve: com.google.android.gms:play-services-gcm:17.0.3
Install Repository and sync project
Show in Project Structure dialog
Affected Modules: app


ERROR: Failed to resolve: com.google.firebase:firebase-ads:17.0.3
Show in Project Structure dialog
Affected Modules: app


ERROR: Failed to resolve: com.google.firebase:firebase-database:17.0.3
Show in Project Structure dialog
Affected Modules: app


ERROR: Failed to resolve: com.google.firebase:firebase-core:17.0.3
Show in Project Structure dialog
Affected Modules: app


ERROR: Failed to resolve: com.github.bmarrdev:android-DecoView-charting:v1.2
Show in Project Structure dialog
Affected Modules: app


ERROR: Failed to resolve: com.google.android.gms:play-services-ads:17.0.3
Install Repository and sync project
Show in Project Structure dialog
Affected Modules: app


ERROR: Failed to resolve: com.google.android.gms:play-services-analytics:17.0.3
Install Repository and sync project
Show in Project Structure dialog
Affected Modules: app


ERROR: Failed to resolve: com.google.firebase:firebase-messaging:17.0.3
Show in Project Structure dialog
Affected Modules: app


ERROR: Failed to resolve: com.google.android.gms:play-services-location:17.0.3
Install Repository and sync project
Show in Project Structure dialog
Affected Modules: app


ERROR: Failed to resolve: com.google.android.gms:play-services-ads-identifier:17.0.3
Install Repository and sync project
Show in Project Structure dialog
Affected Modules: app


ERROR: Failed to resolve: com.google.android.gms:play-services-base:17.0.3
Install Repository and sync project
Show in Project Structure dialog
Affected Modules: app]

确保您的顶级build.gradle包含对google()repo或maven{url”“}的引用。首先,您应该确保使用的是相同版本的Android支持库(例如,您正在为其他Android支持库使用Android Design/RecyclerView支持库的版本
28.0.0
,而为其他Android支持库使用
26.x.x
)。其次,您多次定义了一些依赖项(例如,您已经声明了两次Android RecyclerView支持库)最后,正如@Md.Asaduzzaman所提到的,确保您已经声明了对
google()
repo的引用,或者如果您使用的是Gradle低于4.1的版本,请手动指定Maven URL。我建议您通过转到重构菜单并单击迁移到androidx来切换到androidx