-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Provide warning about using "allowBackup" with Hilt #2798
Comments
@pablobaxter do you have a recommendation for where you would want this information to be located, e.g. javadoc of some class/annotation vs somewhere in the dagger.dev/hilt documentation? |
A few places, for example:
Basically, anywhere where it states that the |
We discussed this and I think maybe a known issues or FAQ section on the site will be good for longstanding issues like this. |
Both of those options are great places for this known issue, but a concern I have is that these crashes and issues are not always obvious as to what is the root cause. I spent some months to narrow an issue down to it being because of me overriding the Having some sort of note about overriding |
We just found this issue after years of trying to understand Play Console reports that our app was crashing with Not being able to use |
Currently, there's a known issue with
android:allowBackup=true
and having a subclassedApplication
in that if a service or receiver is triggered while the app is backing app and attempts to inject a context, it could potentially crash. A side effect is that a crash while the app is backing up will leave it in the "restricted" mode that disabled the subclassedApplication
, and the next app start (either user initiated or via intent) will cause injection to fail once again.Google bug ticket describing this: https://issuetracker.google.com/issues/160946170
Given that Hilt requires we subclass
Application
, there should also be a warning about using backup on the app as well.The text was updated successfully, but these errors were encountered: