-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Dispatchers.setMain not working for 1.6+ versions #3244
Comments
same here |
Hi! This could be caused by a version mismatch, that is, if the If this is not the case, please provide an example of a project where this issue reproduces so I could take a look at it. |
|
|
trying to add |
It would be really helpful if someone could add a reproducing project. Mismatched versions shouldn't be an issue since #2952, so it's probably something else that we potentially can workaround on our side |
If your class under test starts coroutines from its constructor and is constructed as a field in your test this will run before any
Simplest fix is to change to
|
Any new update on the fix ? I have the same issue even if I add |
We still need the reproducer in order to fix the issue, or at least to report it to the responsible party. It works in general setups, but for some Android projects it doesn't, and we need a reproducer to pinpoint the issue |
This works for me. With Suggest to close this issue, because for my case issue is not relevant. |
Currently, using
1.5.2
, everything works fine.After library update to
1.6.0
or1.6.1
version, I'm receiving messageModule with the Main dispatcher had failed to initialize. For tests Dispatchers.setMain from kotlinx-coroutines-test module can be used
. Same message I receive, if I just remove@BeforeTest fun setup() { Dispatchers.setMain ...
for1.5.2
.Tried to add
MainCoroutineRule
- no use.What could be a problem?
The text was updated successfully, but these errors were encountered: