Huawei app crashed when launching after updating libraries

After updating some libraries my huawei app is crashing when launching. The splash screen is shown for 1 second and then the app stops.

I updated agconnect to the latest version (1.9.1.303) and my gradle version is 8.6.0.

And these are the logs:

java.lang.NoClassDefFoundError: Failed resolution of: Lro/datakit/util/EventBus;
    at ro.base.architecture.activity.BaseActivity.Y2(SourceFile:8)
    at ro.base.architecture.activity.BaseActivity.A2(SourceFile:27)
    at ro.base.architecture.activity.BaseActivity.onCreate(SourceFile:4)
    at ro.ui.auth.login.activity.LoginActivity.onCreate(SourceFile:1)
    at android.app.Activity.performCreate(Activity.java:8086)
    at android.app.Activity.performCreate(Activity.java:8074)
    at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1313)
    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3755)
    at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3961)
    at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:91)
    at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:149)
    at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:103)
    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2386)
    at android.os.Handler.dispatchMessage(Handler.java:107)
    at android.os.Looper.loop(Looper.java:213)
    at android.app.ActivityThread.main(ActivityThread.java:8178)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:513)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1101)
Caused by: java.lang.ClassNotFoundException: ro.datakit.util.EventBus
    ... 19 more

Here are my libraries:

googleImplementation 'com.huawei.hms:location:6.7.0.300'
googleImplementation 'com.huawei.hms:maps:6.6.1.301'

// huawei libs
huaweiImplementation 'com.huawei.agconnect:agconnect-core:1.9.1.303'
huaweiImplementation 'com.huawei.hms:base:6.2.0.300'
huaweiImplementation 'com.huawei.hms:hwid:6.12.0.300'
huaweiImplementation 'com.huawei.hms:push:6.12.0.300'
huaweiImplementation 'com.huawei.hms:hianalytics:6.7.0.300'
huaweiImplementation 'com.huawei.agconnect:agconnect-crash:1.9.1.303'
huaweiImplementation 'com.huawei.hms:location:6.7.0.300'
huaweiImplementation 'com.huawei.hms:maps:6.11.0.304'
huaweiImplementation 'dev.supasintatiyanupanwong.libraries.android.huawei.maps:maps-utils:1.0.0-alpha03'



allprojects {
    buildscript {
        ext.kotlin_version = '1.8.0'
        repositories {
            google()
            mavenLocal()
            mavenCentral()
            maven { url 'https://jitpack.io' }
            maven { url 'https://developer.huawei.com/repo/' }
        }

        dependencies {
            classpath 'com.android.tools.build:gradle:8.6.0'
            classpath "io.realm:realm-gradle-plugin:10.18.0"
            classpath 'com.google.gms:google-services:4.4.2'
            classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"

            // Add the Firebase Crashlytics Gradle plugin.
            classpath 'com.google.firebase:firebase-crashlytics-gradle:2.9.2'

            classpath 'com.huawei.agconnect:agcp:1.9.1.303'
            classpath 'com.huawei.hms.plugin:analytics:5.0.1.300'
        }
    }
}

Here is my EventBus class which you can see it’s in the correct path.

package ro.datakit.util

import androidx.lifecycle.MutableLiveData
import ro.datakit.rest.response.auth.AuthorizeResponse

object EventBus {
    val BUS = MutableLiveData<AuthorizeResponse>()

    val LOGOUT_BUS = MutableLiveData<Boolean>()
}

Also here is my build.gradle (:datakit)

apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-kapt'
apply plugin: 'kotlin-parcelize'
apply plugin: 'realm-android'

android {
    compileSdk 34

    publishNonDefault true

    defaultConfig {
        minSdkVersion 23
        buildConfigField "boolean", "SHOW_CAN_NETWORK_CONSOLE", "false"
    }

    flavorDimensions "default", "services"

    productFlavors {
        live {
            dimension "default"
        }
        stage {
            dimension "default"
            buildConfigField "boolean", "SHOW_CAN_NETWORK_CONSOLE", "true"
        }
        dev {
            dimension "default"
        }
        preprod {
            dimension "default"
            buildConfigField "boolean", "SHOW_CAN_NETWORK_CONSOLE", "true"
        }
        google {
            dimension "services"

        }
        huawei {
            dimension "services"
        }
    }

    buildTypes {
        release {
            minifyEnabled false
            proguardFile 'proguard-project.pro'
            proguardFile getDefaultProguardFile('proguard-android.txt')
        }
        debug {

        }
    }

    kotlinOptions {
        jvmTarget = JavaVersion.VERSION_1_8.toString()
    }
    lint {
        abortOnError false
        ignoreWarnings true
        quiet true
    }
    namespace 'ro.datakit'
}

dependencies {
    // kotlin
    api 'androidx.lifecycle:lifecycle-livedata-ktx:2.8.5'

    api project(':basic')
}

realm {
    syncEnabled = false
}

repositories {
    mavenCentral()
}

5

After hours of research I discovered that adding android.enableR8.fullMode=false to my gradle.properties file solved the issue. No idea why, but maybe this will help someone.

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật