This is a very easy error to fix and usually is caused when you change a Room entity configuration. For testing purposes, just increment your version number in your abstract RoomDataBase() class & add a call to “.fallbackToDestructiveMigration()” just before “.build()” on your Room.databaseBuilder() call. NOTE, THAT THIS MAY DESTROY ALL SAVED DATA AND SHOULD…(Continue Reading)
Category: kotlin
Cannot find symbol class FragmentIngredientEditBindingImpl DataBinderMapperImpl.java
This was a rather cryptic Gradle build error for a Kotlin App I was testing. Turns out, I had used the wrong object variable name of @{vm.ingredient.quantity + “”} The correct object variable was named “sourceQuantity”. Fix: Check your variable names in your XML layout files. Once I corrected the name my app build was…(Continue Reading)
Excellent books to expand programming skills.
Kotlin and Android Development featuring Jetpack – Covers a vast array of Kotlin features, with a good focus on Jetpack. This may have been the most difficult read I’ve ever encountered, but I started it with almost no understanding of app development with Kotlin, never mind Jetpack. I highly recommend this book to anyone currently…(Continue Reading)
Firebase addOnSuccessListener() and addOnFailureListener() to a .setValue() call in Kotlin
When the record write succeeds, I want to show them a “purchase complete” fragment, and if the record is not created, I want to at least warn them with an error code.
Use Care in Kotlin when Calculating Future Dates with Epoch Times
So, I’m left for my sage advice of the moment: “Use care in Kotlin when calculating future dates with epoch times”. Make sure any amounts you add to an epoch time are of the Long data type, just in case you edit the code later and forget to change it.
Firebase Database paths must not contain ‘.’, ‘#’, ‘$’, ‘[‘, or ‘]’
I’m trying to minimize the amount of data downloaded for subscriber accounts. I’d like to store all of my subscribers in the path /subscribers/[emailAddress]/ on my Firebase Database. If I can’t use the email address as part of the path, I’ll be forced to download the entire list of subscribers and then search through the…(Continue Reading)
postValue() not working from MainActivity.kt
I have a View Model named “subsViewModel” that I’m storing subscription details for use by various fragments and MainActivity.kt. When a user authenticates with Google Firebase authentication, I want to store the user’s details into subsViewModel as shown below: Authenticate, Store Firebase User Information // Authenticate users: auth = Firebase.auth if (auth.currentUser == null){ //…(Continue Reading)
java.text.ParseException: Unparseable date: “”
Logcat Fatal Exception caused by: subscription?.nextExpirationAsEpoch = SimpleDateFormat(“MM/dd/yyyy”).parse(subscription?.nextExpiration).time
When reading subscription records from a firebase realtime database.
Fatal Exception when iterating over firebase real-time database keys caused by a blank secondary database key. Possible fixes included ensuring the secondary key and the date string are not null, as well as logging errors with a toast.