Description
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.