Closed nishkul closed 1 year ago
Hey @nishkul , did you find any solution? I was trying to do backup in WorkManager using CoroutineWorker
and got the similar error. I guess it's about RoomBackup instance creation with context.
@rafi0101 Is there any workaround?
I was calling the wrong way, it should have called before clicking lister backup = RoomBackup(MainActivity@this), which solved the crash for me. tried on both activity and fragment
@nishkul nice that you have found out the solution by yourself This is already content of my documentation: https://github.com/rafi0101/Android-Room-Database-Backup#properties
java.lang.ClassCastException: dagger.hilt.android.internal.managers.ViewComponentManager$FragmentContextWrapper cannot be cast to androidx.activity.ComponentActivity at de.raphaelebner.roomdatabasebackup.core.RoomBackup.(RoomBackup.kt:696)