-
Notifications
You must be signed in to change notification settings - Fork 1.3k
App keeps crashing on opening #3607
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
Comments
Does this happen in the prod build variant? |
Yes, it happens on prodDebug too. I have added some more system logs that I missed earlier. |
@6point022 I know this isn't a solution to the actual problem you've reported. But just try clearing the app's data and using the app. You would not experience the crash. |
The reason for the actual problem is very clear in the error message. Quoting the relevant portion:
|
@sivaraam Thanks a lot, it worked! :D |
Let me add some information about why we're facing this issue based on the little knowledge about Room that I have. As the error message clearly states the schema has changed without the version number being changed.
Kindly correct me if I'm wrong somewhere as what I've mentioned is purely based on what I remember and it's been rusty for a while. 🙂 cc @misaochan |
I am also facing the same issue on fresh install. @ashishkumar468 Can this be related to your recent change? |
@maskaravivek. Not sure (None of my recent PR's have updated the schema), I will have a look, even if because of some reason, the schema was updated, it should not throw an exception on fresh installs, are you sure you faced the same on fresh installs? |
I just noticed that even on uninstalling the app and reinstalling the data wasn't cleared. Once I clear all app data, it works for me. |
That's weird, uninstalling should clear data. |
@ashishkumar468 yes you are right this happened to me when I switched branch from master to 2.13-release but upon reinstalling it got fixed |
Yes, one of the PR' must-have updated the schema. Should not be an issue though, because since room has been added, no releases have been made. So for end-user, this won't make a difference, although we should add migrations whenever a schema update is done. |
Ah, okay. I can remove this from the release list then, but we would need to make sure that this doesn't happen again in the future (because then it will impact end users). |
The same thing happened for me. Uninstalling and reinstalling didn't work, only clearing app data manually via Settings worked. |
are ye running There should be no AppData to clear if it is fully uninstalled |
Oh, right! Yes, I had beta installed, whoops. |
Is there something here to do or can we close this? |
I would like to discuss if there is a way to ensure that this doesn't happen again in the future - we were lucky that Room was implemented post the last release, but if we weren't then this would be impacting end users. Is there a process that we can implement that must be followed for schema updates, perhaps? |
There are 2 camps for this, or at least 2 that I have followed
At release time testing that we can update from a previous version should be done regardless because you need to test your migration code. I favour 2 though it does require some ownership of that code from someone at release time. 1 can be a bit hard to catch I find especially since so many people could add/remove/rename a field on a model and not see that that has an effect on the database. Regardless we should all be following the advice of Barty Crouch pretending to be Mad Eye Moody, constant vigilance! |
Option 2 sounds good if we are confident we won't miss that before release (else we get a lot of angry users!). I'm just wondering about one other thing though. AFAIK, we frequently publish alpha versions to play store. If we push the migration to just before release those intermediate alpha updates would result in a crash (if the schema is changed, of course), wouldn't it? Would that be fine as it's just the alpha version? |
yes, right. the app will crash for them. I guess we should go with option 1 as on every commit to master an alpha release is made. Also, from a maintenance standpoint, it might be easier to have migrations for every change. |
It is that or communicate to alpha users that they will need a fresh install on some versions, alphas are never renowned for their stability. The thing I don't like about option 1 is how much extra code it adds but it is the "safer" option and causes less friction for our alpha users |
I would be in favour of option 1 as well. While I'm sure our alpha testers will understand, we would still want to reduce the number of crashes that they encounter, if only because we will have to sift through all of the crash reports to find the "real" reports in the sea of "schema update" reports. As you guys have said, it is safer as well and there is clear code ownership. |
There is 1 more alternative if we don't particularly care about migrating our data between app versions
It isn't great but as long as we keep increasing the schema number there are no crashes. There is no data retention between versions though. We could run a hybrid of option 2 and this, I am pretty sure a |
Having this in place sounds good to me. With this in place, we could do proper migrations just for beta/prod releases. |
The discussed solution has already been implemented on the current master. Closing this issue, feel free to re-open if the issues comes up again. |
I am facing the same issue but fallbackToDestructiveMigration() is not working. Whenever I upload data from database to my recyclerView it crashes (PS I'm. a beginner so I don't really know that much and desperately need help ) |
how to change this version number ?? |
@Gunin2001 IIUC, updating the version number shouldn't be necessary if |
I just happened to face the Room crash myself when upgrading from I sent the log of that crash to the private crash list. |
what finally worked for me was
PS:- I don't know if a specific thing works . So, I mentioned all the steps it took me to clear the error |
Thanks @Gunin2001 ! For me clearing the data of the app alone works reliably :) The issue is it was made unnecessary. It's not clear why it has become necessary again. |
Yeah, a lot of programmers on stackoverflow also said that it works for them as well, but I was stuck on that for days and all these steps helped me out. |
This seems to be the same with the crash at #4435 . So it seems that we just need to upgrade the version number before we release to Google Play. |
@nicolas-raoul This issue is pretty old and the app does not crash now , it works fine so we can safely close this issue |
Summary:
App keeps crashing on opening.
Steps to reproduce:
I cloned the repo from GitHub and tried to compile it. Can't open the app now.
System logs:
Device and Android version:
Redmi Note 5 Pro
MIUI version 11
Android 9
Commons app version:
master betaDebug
The text was updated successfully, but these errors were encountered: