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鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
Application crashes on Android 10 (API 29) Samsung Galaxy Note 10 #2
Comments
Hey Tom, Not sure how your post above got posted into this project because it was originally posted under the older project. Seems like a bug in Github. Thanks for the feedback. The project you were referring to is deprecated and no longer supported. It has been replaced with Jetmagic: https://github.com/JohannBlake/Jetmagic Jetmagic is a far superior framework. As for the issue you raised, I'm not sure what is causing the crash. I use that same line of code in Jetmagic but have never had any issues and have tried it out on a few devices running different OS versions. Download Jetmagic and run it. If the bug still happens, please let me know by posting the issue in Jetmagic and I'll look into it. It is possible that something else was causing the bug in this project and got corrected in Jetmagic. As for reflection, that unfortunately is the only way I could create an instance of a class without knowing the class name. The "new" keyword doesn't exist in Kotlin but I know what you mean. As for speed, I don't really see any performance issues, even when running it on older devices. |
Ok, tested with Jetmagic and is working 馃憤
Yeah You're right this is only way in runtime but You can use Code generation as an option. Maybe You don't need to create viewmodel that way. (I know it is optional) |
Jetmagic is still new, so I'm waiting to get some more usage to see how to take it forward. One idea on the viewmodel is to provide a callback in Composable Resource that lets the developer create one however they want. It would also allow them to do DI if want. |
Hi, as I said I will give a try your solution 馃槃
I think I found some problem. I mean reflection.
Generally reflection is bad idea. Statistically object initialization is about 10 times slower then
new
operator.But it looks like compose have some additional policy in terms of reflection call inside compose functions
This line is breaking application startup (100% case)
composableInstance.viewmodel = composableResource.viewmodelClass.newInstance() as ViewModel
The text was updated successfully, but these errors were encountered: