Different android support versions in packages?

断了今生、忘了曾经 提交于 2020-03-25 18:38:17

问题


I am trying to adapt the classytaxi app to androidx:

I needed to get multidex activated (in the gradle file, the manifest had already a name field asigned to .SubApp in the application Tag, see manifest snippet).

I get this error:

java.lang.NoClassDefFoundError: Failed resolution of: Lcom/google/android/gms/internal/zzbgl; [...] Caused by: java.lang.ClassNotFoundException: Didn't find class "com.google.android.gms.internal.zzbgl" on path: DexPathList [...]

according to that question, the error is related to non consistent support library versions. I cannot find any failure here. or maybe its the multidex?

EDIT: maybe the support library is included as well in other libraries with a different version?

Any help, please?

manifest snippet:

<uses-permission android:name="com.android.vending.BILLING" />

<application
    android:name=".SubApp"
    android:allowBackup="true"
    android:icon="@mipmap/ic_launcher"
    android:label="@string/app_name"
    android:roundIcon="@mipmap/ic_launcher_round"
    android:supportsRtl="true"
    android:theme="@style/AppTheme">

the projectlevel gradle snippet:

   // Android version information.
androidMinimumSdkVersion = 17
androidTargetSdkVersion = 28
androidCompileSdkVersion = 28
androidBuildToolsVersion = '28.0.3'
}

buildscript {
// Library versions.
ext.archCoreVersion = '1.1.1'
ext.archLifecycleVersion = '1.1.1'
ext.archRoomVersion = '1.1.1'
ext.billingVersion = '2.1.0'
ext.firebaseAuthVersion = '19.2.0'
ext.firebaseCoreVersion = '17.2.3'
ext.firebaseFunctionsVersion = '19.0.2'
ext.firebaseMessagingVersion = '20.1.1'
ext.firebaseUiVersion = '3.3.0'
ext.glideVersion = '4.11.0'
ext.gsonVersion= '2.8.6'
ext.jsonVersion = '20140107'
ext.supportVersion = '28.0.0'

// Tools versions.
ext.gradleGoogleVersion = '3.2.0'
ext.gradleToolsVersion = '3.6.0'
ext.kotlinVersion = '1.3.61'

// Testing versions.
ext.jUnitVersion = '4.13'

repositories {
    google()
    jcenter()
}
dependencies {

    classpath "com.android.tools.build:gradle:${gradleToolsVersion}"
    classpath "com.google.gms:google-services:4.0.0"
    classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion"
    classpath "org.jetbrains.kotlin:kotlin-android-extensions:$kotlinVersion"

app level build.gradle snippet:

dependencies {
// Google Play Billing Library.
implementation "com.android.billingclient:billing:$billingVersion"

// Android Support Library.
//    implementation "com.android.support:design:$supportVersion"
implementation "com.google.android.material:material:1.2.0-alpha05"
implementation "androidx.legacy:legacy-support-v4:1.0.0"
implementation "com.google.code.gson:gson:$gsonVersion"

// Glide image library.
implementation("com.github.bumptech.glide:glide:$glideVersion") {
    exclude group: "com.android.support"
}

implementation 'androidx.multidex:multidex:2.0.1'

// Firebase libraries.
implementation "com.google.firebase:firebase-auth:$firebaseAuthVersion"
implementation "com.google.firebase:firebase-core:$firebaseCoreVersion"
implementation "com.google.firebase:firebase-functions:$firebaseFunctionsVersion"
implementation "com.google.firebase:firebase-messaging:$firebaseMessagingVersion"

// FirebaseUI Auth library.
implementation "com.firebaseui:firebase-ui-auth:$firebaseUiVersion"

// Kotlin library.
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlinVersion"

// ViewModel and LiveData extensions.
implementation "android.arch.lifecycle:extensions:$archLifecycleVersion"

// Java8 support for Lifecycles.
implementation "android.arch.lifecycle:common-java8:$archLifecycleVersion"

// Room Architecture Components.
implementation "android.arch.persistence.room:runtime:$archRoomVersion"

// Kotlin annotation processor for Room.
kapt "android.arch.persistence.room:compiler:$archRoomVersion"

// Test dependencies.
testImplementation "junit:junit:$jUnitVersion"
implementation 'androidx.cardview:cardview:1.0.0'
implementation 'androidx.appcompat:appcompat:1.1.0'

来源:https://stackoverflow.com/questions/60461110/different-android-support-versions-in-packages

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!