Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Facing issue while trying to read collection from firestore #590

Open
ahmad244221 opened this issue Aug 26, 2024 · 4 comments
Open

Facing issue while trying to read collection from firestore #590

ahmad244221 opened this issue Aug 26, 2024 · 4 comments
Labels
API coverage Request for missing APIs

Comments

@ahmad244221
Copy link

ahmad244221 commented Aug 26, 2024

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

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

Below 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) }

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

@ahmad244221 ahmad244221 added the API coverage Request for missing APIs label Aug 26, 2024
@nbransby
Copy link
Member

@Daeda88 any clue on this?

@ahmad244221
Copy link
Author

ahmad244221 commented Aug 27, 2024

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

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

  1. val tokenResponse = auth.signInWithCustomToken(customtoken)
    val response = firestore.collection("collectionPath")
    .document("documentPath").get().data(ServerTimestampBehavior.ESTIMATE)
    println("response... $response")`

In both cases I am getting same exception -
Caused by: java.lang.ClassNotFoundException: Didn't find class "dev.gitlive.firebase.DecodersKt"

@ahmad244221
Copy link
Author

Please let me know if any more input needed here. Is this DecodersKT an internal class and not exposed publicly.
Please suggest for any alternate solution to overcome this issue.

@Daeda88
Copy link
Contributor

Daeda88 commented Aug 29, 2024

DecodersKt has been moved to dev.gitlive.firebase.internal, so the fact your logging is trying to get it from dev.gitlive.firebase indicates to me that something is wrong in your setup. Are you sure you use a consistent version of the sdk for all of your modules?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
API coverage Request for missing APIs
Projects
None yet
Development

No branches or pull requests

5 participants
@nbransby @Daeda88 @ahmad244221 and others