skip to Main Content

I am facing ClassNotFoundException while reading collection. I have added all the needed dependencies in gradle file. I did the sign in process with custom token.

Exception I am getting is mentioned below –

Caused by: java.lang.ClassNotFoundException: Didn't find class "dev.gitlive.firebase.DecodersKt"

Here is the shared module gradle dependencies

val commonMain by getting { 
    dependencies { 
    implementation(libs.kotlinx.coroutines.core) 
    implementation(libs.ktor.client.core) 
    implementation(libs.ktor.client.content.negotiation) 
    implementation(libs.ktor.serialization.kotlinx.json) 
    implementation(libs.ktor.client.logging) 
    implementation(libs.koin.core) 
    implementation(libs.sql.coroutines.extensions) 
    implementation(libs.firebase.firestore)
    implementation(libs.firebase.common)
    implementation(libs.kotlinx.serialization.json) 
    implementation(libs.firebase.auth) }
    }

These are android module denpencies.

dependencies {
implementation(projects.shared) 
implementation(libs.compose.ui) 
implementation(libs.compose.ui.tooling.preview)
implementation(libs.compose.material3) 
implementation(libs.androidx.activity.compose) 
implementation(libs.androidx.appcompat) 
implementation(libs.androidx.constraintlayout) 
implementation(libs.material) 
implementation(libs.androidx.lifecycle.livedata.ktx) 
implementation(libs.androidx.lifecycle.viewmodel.ktx) 
implementation(libs.androidx.navigation.fragment.ktx) 
implementation(libs.androidx.navigation.ui.ktx) 
debugImplementation(libs.compose.ui.tooling) 
implementation(libs.koin.android) 
implementation(platform(libs.google.firebase.bom)) 
implementation(libs.firebase.common.ktx) 
implementation(libs.google.firebase.common) 
}

Below are lines of code I am trying to read collection after calling signInWithCustomToken() –

tokenResponse = auth.signInWithCustomToken(customtoken)
val response = firestore.collection("collectionPath")
.document("documentPath").get().data(MyDataClass.serializer())
println("response... $response")

//Exception
Caused by: java.lang.ClassNotFoundException: Didn't find class "dev.gitlive.firebase.DecodersKt"


Please suggest if anyone faced this issue or some workaround to fix this issue.

Here is the library link –
https://firebaseopensource.com/projects/gitliveapp/firebase-kotlin-sdk/

2

Answers


  1. Chosen as BEST ANSWER

    Thanks Robert Jaminson for your answer, you are right after changing the version it worked for me.

    My answer is late but might help others.


  2. Based on what I’m seeing, you should only be accessing dev.gitlive.firebase.internal.decode unless you’re using a much older version of the dependency. That dev.gitlive.firebase.DecodersKt file hasn’t been in place since version 1. Their SDK is on version 2.1.0 right now.

    Is your dependency version up-to-date?

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search