I have developed an Android library and successfully deployed Jar file on GitHub Packages. However, I am encountering a crash while attempting to integrate Firebase within my library. The reason for this integration is to fetch certain remote config keys from Firebase.
The crash I am experiencing is as follows:
Caused by: java.lang.ClassNotFoundException: Didn't find class "com.google.firebase.FirebaseApp" on path: DexPathList[[zip file "/data/app/com.insightlearning.sti.app.dev-HQFBWdojqebHjBaT6QXO4g==/base.apk"],nativeLibraryDirectories=[/data/app/com.insightlearning.sti.app.dev-HQFBWdojqebHjBaT6QXO4g==/lib/arm64, /system/lib64, /system/product/lib64]]
and below are my firebase configurations and dependencies
Project Level Gradle:
buildscript {
dependencies {
classpath("com.android.tools.build:gradle:8.1.0")
classpath("com.google.gms:google-services:4.4.0")
classpath("com.google.firebase:firebase-crashlytics-gradle:2.9.9")
}
}
// Top-level build file where you can add configuration options common to all sub-projects/modules.
plugins {
id("com.android.application") version "8.2.0" apply false
id("org.jetbrains.kotlin.android") version "1.9.10" apply false
id("com.android.library") version "8.2.0" apply false
}
App Level Gradle
plugins {
id("com.android.application")
id("org.jetbrains.kotlin.android")
id("com.google.gms.google-services")
id("com.google.firebase.crashlytics")
}
Library Level Gradle
plugins {
id("com.android.library")
id("org.jetbrains.kotlin.android")
id("maven-publish")
id("kotlin-kapt")
id("com.google.dagger.hilt.android")
id("kotlin-android-extensions")
id("com.google.firebase.crashlytics")
}
api (platform("com.google.firebase:firebase-bom:31.2.0"))
api ("com.google.firebase:firebase-analytics-ktx")
api ("com.google.firebase:firebase-crashlytics-ktx")
Could someone provide guidance or insights into how I can effectively integrate Firebase into my Android library? Additionally, are there any specific considerations or steps I might be missing that could be causing this crash?
Any help or suggestions would be greatly appreciated. Thank you!"