Skip to content

App crashes on set document #679

Closed
Closed
@TomerGlick

Description

@TomerGlick

I'm using the firestore code to set data and the app crashing, the logcat printing

java.lang.InstantiationError: dev.gitlive.firebase.EncodeSettings at dev.gitlive.firebase.EncodeDecodeSettingsKt.buildEncodeSettings(EncodeDecodeSettings.kt:68)

@throws(Exception::class)
suspend fun saveRecipes(recipes: List): List {
try {
val firebaseFirestore = Firebase.firestore
val recipesCollection = firebaseFirestore.collection("user_recipes")
for (recipe in recipes) {
val documentId = recipesCollection.document.id
recipesCollection.document(documentId).set(Recipe.serializer(), recipe)
}
Result.success(Unit)
} catch (e: Exception) {
Result.failure(e)
}

}

Also I ran a clean build and I'm getting a warning on the set row -
Cannot access class 'dev.gitlive.firebase.EncodeSettings.Builder' in the expression type. While it may work, this case indicates a configuration mistake and can lead to avoidable compilation errors, so it may be forbidden soon. Check your module classpath for missing or conflicting dependencies.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions