Skip to content
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

Does not work within async #69

Closed
erksch opened this issue May 28, 2021 · 1 comment · Fixed by #82
Closed

Does not work within async #69

erksch opened this issue May 28, 2021 · 1 comment · Fixed by #82

Comments

@erksch
Copy link

erksch commented May 28, 2021

I am trying to log with Napier from within an async block.

fun testLog() = coroutineScope {
    someList.map { element ->
        async {
            Napier.d( "Processing $element")
            someSuspendFunc(element)
            Napier.d("Done processing $element")
        }
    }.awaitAll()
}

Running the code in iOS gives the following error:

kotlin.native.IncorrectDereferenceException: Trying to access top level value not marked as @ThreadLocal or @SharedImmutable from non-main thread

Any solution for this?

@AAkira
Copy link
Owner

AAkira commented Aug 16, 2021

Please check 2.0.0-alpha2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants