-
Notifications
You must be signed in to change notification settings - Fork 67
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
[Android] Nullpointer exception while creating Settings instance #127
Comments
Seems weird, but that doesn't really give me enough information to understand what's going on. Since 0.8 is pretty old, can you try it on a newer version such as 1.0.0-alpha01? |
@russhwolf regarding the issue raised, i have a kmm app that i try to test with robolectric from android module (android/src/test). And the stack trace below
|
I don't think androidx.startup gets initialized in a Robolectric test. There's not really much Multiplatform Settings can do there. I could think about adding an API where you could inject your test |
I have the same issue, and I've tried the new 1.0.0-RC version but unsuccessfully. |
Same here, the merged manifest seems ok, the
|
Again, I don't expect this to work from a Robolectric test because I don't think Robolectric correctly initializes ContentProviders like androidx.startup uses. If you need to test code that talks to your |
I had the same issue in my app with multiple processes, so I fixed it with an explicit call of the library initializer in my AppInitializer.getInstance(getApplicationContext()).initializeComponent(SettingsInitializer.class); |
Oh that's interesting. |
I plan to make |
I'm also having the same error when I try to initialize my kmm library(which uses settings-no-arg) in my android App's onCreate method |
|
We are receiving crash while creating instance of Settings on Android. Looks its not able to get context from androidx-startup ?
version: 0.8
The text was updated successfully, but these errors were encountered: