简体   繁体   中英

build error when adding crashlytics dependency in android

I want to add Crashlytics in my project

I add below dependency

implementation 'com.google.firebase:firebase-crashlytics:17.3.0'

my project dependencies

implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation 'com.android.support.constraint:constraint-layout:1.0.2'
implementation 'com.google.code.gson:gson:2.8.0'
implementation 'com.google.android.gms:play-services-maps:11.8.0'
implementation 'com.google.android.gms:play-services-vision:11.8.0'
implementation 'com.google.android.gms:play-services-location:11.8.0'
implementation 'com.google.android.gms:play-services-analytics:11.8.0'
implementation 'me.anwarshahriar:calligrapher:1.0'
implementation 'com.baoyz.swipemenulistview:library:1.3.0'
implementation 'joda-time:joda-time:2.9.9'
implementation 'me.dm7.barcodescanner:zbar:1.9.8'
testImplementation 'junit:junit:4.12'
implementation 'com.google.apis:google-api-services-storage:v1-rev135-1.23.0'
implementation 'com.google.firebase:firebase-messaging:11.8.0'
implementation 'com.google.firebase:firebase-iid:11.8.0'
implementation 'com.google.firebase:firebase-core:11.8.0'
implementation 'com.google.firebase:firebase-crash:11.8.0'
implementation 'com.google.firebase:firebase-firestore:11.8.0'
implementation 'de.hdodenhof:circleimageview:2.2.0'
implementation 'com.android.volley:volley:1.1.1'
implementation 'com.wdullaer:materialdatetimepicker:3.6.3'
implementation 'com.android.support:support-v4:28.0.0-rc02'
implementation 'com.android.support:support-v13:28.0.0-rc02'
implementation 'com.android.support:cardview-v7:28.0.0-rc02'
implementation 'com.android.support:appcompat-v7:28.0.0-rc02'
implementation 'com.android.support:recyclerview-v7:28.0.0-rc02'
implementation 'com.android.support:design:28.0.0-rc02'
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation 'com.google.code.gson:gson:2.8.5'
implementation group: 'org.apache.httpcomponents', name: 'httpmime', version: 
'4.3.1'
implementation 'com.squareup.retrofit2:retrofit:2.3.0'
implementation 'com.squareup.retrofit2:converter-scalars:2.3.0'
implementation 'com.squareup.retrofit2:converter-gson:2.3.0'
implementation 'com.pusher:chatkit-android:1.0.0'
implementation 'com.github.bumptech.glide:glide:3.7.0'
implementation 'com.itextpdf:itextg:5.5.10'
implementation 
'com.toptoche.searchablespinner:searchablespinnerlibrary:1.3.1'
implementation 'com.github.f0ris.sweetalert:library:1.5.1'
implementation 'com.google.firebase:firebase-database:11.8.0'
implementation 'com.google.firebase:firebase-auth:11.8.0'

// Retrofit
implementation 'com.squareup.retrofit2:retrofit:2.4.0'
implementation 'com.squareup.retrofit2:converter-gson:2.4.0'
implementation 'com.google.firebase:firebase-crashlytics:17.3.0'

I got below error

class com.google.android.gms.maps.model.LatLng, unresolved 
supertypes:com.google.android.gms.internal.zzbfm
e: Supertypes of the following classes cannot be resolved.
Please make sure you have the required dependencies in the classpath:

Dependency after grouping all firebase Dependencies under BoM

dependencies {
    implementation fileTree(include: ['*.jar'], dir: 'libs')
    androidTestImplementation('com.android.support.test.espresso:espresso-core:3.0.2', {
        exclude group: 'com.android.support', module: 'support-annotations'
    })
    implementation fileTree(include: ['*.jar'], dir: 'libs')
    implementation 'com.android.support.constraint:constraint-layout:1.0.2'
    implementation 'com.google.code.gson:gson:2.8.0'
    implementation 'com.google.android.gms:play-services-maps:11.8.0'
    implementation 'com.google.android.gms:play-services-vision:11.8.0'
    implementation 'com.google.android.gms:play-services-location:11.8.0'
    implementation 'com.google.android.gms:play-services-analytics:11.8.0'
    implementation 'me.anwarshahriar:calligrapher:1.0'
    implementation 'com.baoyz.swipemenulistview:library:1.3.0'
    implementation 'joda-time:joda-time:2.9.9'
    implementation 'me.dm7.barcodescanner:zbar:1.9.8'
    testImplementation 'junit:junit:4.12'
    implementation 'com.google.apis:google-api-services-storage:v1-rev135-1.23.0'

    implementation 'de.hdodenhof:circleimageview:2.2.0'
    implementation 'com.android.volley:volley:1.1.1'
    implementation 'com.wdullaer:materialdatetimepicker:3.6.3'
    implementation 'com.android.support:support-v4:28.0.0-rc02'
    implementation 'com.android.support:support-v13:28.0.0-rc02'
    implementation 'com.android.support:cardview-v7:28.0.0-rc02'
    implementation 'com.android.support:appcompat-v7:28.0.0-rc02'
    implementation 'com.android.support:recyclerview-v7:28.0.0-rc02'
    implementation 'com.android.support:design:28.0.0-rc02'
    implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
    implementation 'com.google.code.gson:gson:2.8.5'
    implementation group: 'org.apache.httpcomponents', name: 'httpmime', version: '4.3.1'
    implementation 'com.squareup.retrofit2:retrofit:2.3.0'
    implementation 'com.squareup.retrofit2:converter-scalars:2.3.0'
    implementation 'com.squareup.retrofit2:converter-gson:2.3.0'
    implementation 'com.pusher:chatkit-android:1.0.0'

    implementation 'com.github.bumptech.glide:glide:3.7.0'
    // implementation files('libs/itextpdf-5.3.3.jar')
    implementation 'com.itextpdf:itextg:5.5.10'
    implementation 'com.toptoche.searchablespinner:searchablespinnerlibrary:1.3.1'

    implementation 'com.github.f0ris.sweetalert:library:1.5.1'


    implementation 'com.journeyapps:zxing-android-embedded:3.4.0'

    //FireBase
    implementation platform('com.google.firebase:firebase-bom:26.1.1')
    implementation 'com.google.firebase:firebase-database'
    implementation 'com.google.firebase:firebase-auth'
    implementation 'com.google.firebase:firebase-crashlytics'
    implementation 'com.google.firebase:firebase-analytics'
    implementation 'com.google.firebase:firebase-messaging'
    implementation 'com.google.firebase:firebase-iid'
    implementation 'com.google.firebase:firebase-core'
    implementation 'com.google.firebase:firebase-crash'
    implementation 'com.google.firebase:firebase-firestore'

}

When using Firebase dependencies, the versions must all come from the same "release" point in time. What you have no shows a lot of old Firebase dependencies from many years ago. When you added Crashlytics, it took them all out of sync.

What you will need to do is upgrade all of your Firebase dependencies to match what you see in the documentation . Even better, since you have so many Firebase dependencies, use the Firebase BoM to choose a single release version for all of them without having to specify individual dependency versions.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM