在android中添加crashlytics依赖项时出现java生成错误

yzckvree  于 2021-06-30  发布在  Java
关注(0)|答案(1)|浏览(367)

我想在我的项目中添加crashlytics
我在下面加上

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

我的项目依赖项

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'

我犯了以下错误

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:

将所有firebase依赖项分组到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'

}
kyks70gy

kyks70gy1#

当使用firebase依赖项时,所有版本必须来自同一个“发布”时间点。你所没有的显示了很多年前的旧的firebase依赖关系。当你添加crashlytics的时候,它们都不同步了。
您需要做的是升级所有firebase依赖项以匹配您在文档中看到的内容。更好的是,由于您有如此多的firebase依赖项,因此可以使用firebase bom为所有这些依赖项选择一个版本,而不必指定单独的依赖项版本。

相关问题