【问题标题】:App crashes after upgrading dependencies to latest version in android将依赖项升级到android中的最新版本后应用程序崩溃
【发布时间】:2019-04-16 08:39:19
【问题描述】:

将我的项目升级到最新的依赖项后出现以下错误

没有找到类“com.google.android.gms.common.util.zzq” 路径:DexPathList[[zip 文件“/system/framework/org.apache.http.legacy.boot.jar”, zip 文件 "/data/app/com.example.example-jBf5YcFyN-t4Cm8erTCBwQ==/base.apk"],nativeLibraryDirectories=[/data/app/com.example.example-jBf5YcFyN-t4Cm8erTCBwQ==/lib/x86, /system/lib]]"

apply plugin: 'com.android.application'

android {
    compileSdkVersion 27
    defaultConfig {
        applicationId "com.example.example"
        minSdkVersion 21
        targetSdkVersion 27
        versionCode 1
        versionName "1.0"
        // Enabling multidex support.
        multiDexEnabled true

        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled true
            shrinkResources true
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
    dataBinding {
        enabled true
    }
//    buildToolsVersion '28.0.3'

    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }
}

dependencies {
    implementation fileTree(include: ['*.jar'], dir: 'libs')
    implementation 'com.android.support:appcompat-v7:27.1.1'
    implementation 'com.android.support:animated-vector-drawable:27.1.1'
    implementation 'com.android.support:customtabs:27.1.1'
    implementation 'com.android.support:support-v4:27.1.1'
    implementation 'com.android.support:design:27.1.1'
    implementation 'com.android.support.constraint:constraint-layout:1.1.3'
    implementation 'com.android.support:cardview-v7:27.1.1'

    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.android.support:multidex:1.0.3'
    implementation 'com.android.volley:volley:1.1.0'
    implementation 'com.google.code.gson:gson:2.8.5'
    implementation 'org.jsoup:jsoup:1.10.3'

    implementation 'com.google.android.gms:play-services-maps:16.0.0'
    implementation 'com.google.android.gms:play-services-location:16.0.0'
    implementation 'com.google.android.gms:play-services-places:16.0.0'

    implementation 'com.google.firebase:firebase-messaging:17.3.4'
    implementation 'com.google.firebase:firebase-core:16.0.5'
    implementation 'com.crashlytics.sdk.android:crashlytics:2.9.6'

    implementation 'com.facebook.android:facebook-android-sdk:4.32.0'
    implementation 'com.intuit.sdp:sdp-android:1.0.5'
    /*map place autosuggest*/
    //for calendar class
    implementation 'joda-time:joda-time:2.9.9'
    implementation 'de.hdodenhof:circleimageview:2.2.0'
    //QB dependecies
    implementation 'com.quickblox:quickblox-android-sdk-core:3.8.1'
    implementation('com.quickblox:quickblox-android-sdk-chat:3.8.0') {
        transitive = true
    }
    implementation 'com.quickblox:chat-message-adapter:2.0'
    implementation 'com.quickblox:quickblox-android-sdk-content:3.8.0'
    implementation 'com.timehop.stickyheadersrecyclerview:library:0.4.2@aar'
    implementation 'com.github.orangegangsters:swipy:1.2.3@aar'
    implementation project(':sample-core')

//    implementation 'com.jwang123.flagkit:flagkit:1.0'
}
apply plugin: 'com.google.gms.google-services'
apply plugin: 'io.fabric'

//GoogleServicesPlugin.config.disableVersionCheck = true

谁能指导我如何解决这个问题。 从过去两天开始,我一直在搜索 stackoverflow 以解决此问题。请帮忙。

【问题讨论】:

  • 你可以使用哪个库??
  • 我猜版本号之间存在一些不一致。分享你的 build.gradle 文件
  • 这是因为您的项目中同一库的不同版本。检查 build.gradle 中的警告,这在这些情况下很有帮助。
  • @ZUNJAE 请检查我是否添加了 gradle 文件

标签: android gradle android-gradle-plugin google-play-services android-multidex


【解决方案1】:
Ensure that your top-level build.gradle contains a reference to the google() repo or to maven { url "https://maven.google.com" }.

从你的 build.gradle 文件中删除它并再次同步

 apply plugin: 'com.google.gms.google-services'

【讨论】:

  • 这是使用 crashlytics 所必需的...删除它会导致编译时间问题
  • 请查看此文档以了解 crashlytics。无需使用应用插件:'com.google.gms.google-services。 firebase.google.com/docs/crashlytics/get-started#android
  • ok done..终于解决了...虽然需要根据我的项目要求更改一些东西。
  • 我强制要求 google play 服务插件使用实现 'com.crashlytics.sdk.android:crashlytics:2.9.6' 否则它会给我类似“Crashlytics found an invalid API key: null . 检查 Crashlytics 插件以确保应用程序已成功添加!联系 support@fabric.io 寻求帮助。”你能帮忙吗?@Sultan Mahmud
  • @divaPrajapati09 您为解决此问题做了哪些更改?
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2018-08-07
  • 1970-01-01
  • 2013-09-29
  • 1970-01-01
  • 1970-01-01
  • 2020-06-23
相关资源
最近更新 更多