我今天在 Android 项目中使用 Firebase 和 OneSignal 进行通知,突然收到此错误:
Could not find any version that matches com.google.firebase:firebase-sessions:[15.0.0, 16.0.0).
Versions that do not match:
- 1.2.4
- 1.2.3
- 1.2.2
- 1.2.1
- 1.2.0
- + 4 more
Required by:
project :app > com.google.firebase:firebase-crashlytics:18.6.4
我尝试了很多解决方案,但注意到有效。请帮我解决这个问题。 这是我的 build.gradle 文件内容:
dependencies {
constraints {
implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.8.0") {
because("kotlin-stdlib-jdk7 is now a part of kotlin-stdlib")
}
implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.8.0") {
because("kotlin-stdlib-jdk8 is now a part of kotlin-stdlib")
}
}
implementation fileTree(dir: "libs", include: ["*.jar"])
implementation 'androidx.appcompat:appcompat:1.2.0'
implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation 'androidx.navigation:navigation-fragment:2.3.2'
implementation 'androidx.navigation:navigation-ui:2.3.2'
implementation 'androidx.lifecycle:lifecycle-livedata-ktx:2.5.1'
implementation 'androidx.lifecycle:lifecycle-viewmodel-ktx:2.5.1'
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support.constraint:constraint-layout:2.0.4'
testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
implementation 'androidx.cardview:cardview:1.0.0'
implementation "com.airbnb.android:lottie:3.5.0"
implementation 'me.zhanghai.android.materialratingbar:library:1.4.0'
// material
//noinspection GradleDependency
implementation 'com.google.android.material:material:1.0.0'
// location
implementation 'com.google.android.gms:play-services-maps:18.1.0'
implementation 'com.google.android.gms:play-services-location:21.0.1'
implementation 'com.google.android.libraries.places:places:3.1.0'
/*circular imageView */
implementation 'de.hdodenhof:circleimageview:3.0.1'
/*country code lib*/
implementation 'com.hbb20:ccp:2.4.2'
/*circular viewpager indicator*/
implementation 'com.romandanylyk:pageindicatorview:1.0.0'
implementation 'com.makeramen:roundedimageview:2.3.0'
/*expandable recyclerview*/
implementation 'com.thoughtbot:expandablerecyclerview:1.3'
/*permissions handling lib*/
implementation 'gun0912.ted:tedpermission:2.2.0'
/* image loading lib*/
implementation 'com.github.bumptech.glide:glide:4.11.0'
/*for network call*/
implementation 'com.squareup.retrofit2:retrofit:2.9.0'
implementation 'com.squareup.retrofit2:converter-gson:2.9.0'
implementation 'com.squareup.retrofit2:adapter-rxjava:2.5.0'
implementation 'com.github.Quendel:Multiutils:2.0'
implementation 'com.jaredrummler:material-spinner:1.3.1'
// Firebase
implementation platform('com.google.firebase:firebase-bom:32.8.1')
implementation 'com.google.firebase:firebase-analytics'
implementation 'com.google.firebase:firebase-crashlytics'
implementation 'com.google.firebase:firebase-messaging'
implementation 'com.google.firebase:firebase-database'
implementation 'com.google.android.gms:play-services-basement:18.1.0'
//lifecycle
implementation "android.arch.lifecycle:extensions:1.1.1"
implementation "androidx.lifecycle:lifecycle-common-java8:2.6.1"
// Room Database
def room_version = "2.5.1"
implementation "androidx.room:room-runtime:$room_version"
annotationProcessor "androidx.room:room-compiler:$room_version"
testImplementation "androidx.room:room-testing:$room_version"
// OneSignal
implementation 'com.onesignal:OneSignal:[5.0.0, 5.99.99]'
// spin kit (dialog)
implementation 'com.github.ybq:Android-SpinKit:1.4.0'
// crop picture
implementation 'com.github.yalantis:ucrop:2.2.6'
implementation 'androidx.work:work-runtime:2.8.1'
implementation "androidx.browser:browser:1.5.0"
}
我尝试将 Firebase Boom 版本更改为最新版本,但错误仍然相同。
删除 OneSignal 库后重试。