-
Notifications
You must be signed in to change notification settings - Fork 4.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
Update AndroidManifest.xml #962
Conversation
Disable automatic initialisation for all your components and dependencies otherwise the following exception is generated during application start-up. java.lang.RuntimeException: Unable to get provider androidx.startup.InitializationProvider
Apologies for the (very) delayed response. There hasn't really been anyone able to look after this repo for a while. You're right that this does fix the problem, but could you help me understand why? Sorry for the stupid questions ahead, but I'm not an app developer. Given that these are samples that everyone's going to be copy pasting from, I need to make sure that this is the best fix. I'm a bit confused because a new project created from Android Studio does not include this, but also does not crash. https://developer.android.com/topic/libraries/app-startup seems to imply it's an optional feature of JetPack, but this sample doesn't use that library. It does use the android.app-compat library, but it doesn't use androidx.startup, afaict. It looks to me a lot like there's something else that's wrong, and while this PR definitely makes the problem go away, it may not be the right fix. |
#903 is what did it. That commit shows the problem, the one before does not. Why is still an excellent question, and the changelogs aren't helping. |
I found https://issuetracker.google.com/209387755, where other people have reported the same issue in other applications. I'm really not clear on why this sample needs it, but a freshly generated app (using Studio's Game Activity or Native C++ templates) doesn't. |
Actually, the problem also goes away if we remove the dependencies on androidx, neither of which appear to be used. I'd like to dig into why those are here before ripping them out, but it may just be copy pasta. |
I'm not all that familiar with the appcompat library, but https://developer.android.com/jetpack/androidx/releases/appcompat says it's the backport library, which I could see being useful even in a |
@DanAlbert hi DanAlbert , this pr #997 fix #929 |
Hi Dan, no apologies are necessary, it looks like you've made some helpful progress in narrowing down the underlying cause for this. I'm on business travel right now but I'll try to take a look and see what's happening there between the commits you reference in #903. It may require a little reversing but I'll see if I can discover anything to provide some extra insight. |
Thanks, I'm slowly working through things in order and hadn't made it that far yet :) I'll respond on the various threads in a few. |
I'd actually figured out the same thing you did: The docs for |
Yeah, just retested this and it does work. Not sure what I did wrong yesterday. |
Disable automatic initialisation for all components and dependencies otherwise the following exception is generated during application start-up.
java.lang.RuntimeException: Unable to get provider androidx.startup.InitializationProvider