Skip to content

LogcatWriter fails with UnsatisfiedLinkError on Android JVM test #475

@angusholder

Description

@angusholder

Looks like LogcatWriter is intended to handle the Log class being unavailable in an Android module JVM unit test, but it's throwing UnsatisfiedLinkError, which is not a subclass of Exception which LogcatWriter catches.

} catch (_: Exception) {
testWriter.log(severity, message, tag, throwable)
}

java.lang.UnsatisfiedLinkError: 'int android.util.Log.println_native(int, int, java.lang.String, java.lang.String)'
	at android.util.Log.println_native(Native Method)
	at android.util.Log.d(Log.java:172)
	at co.touchlab.kermit.LogcatWriter.log(LogcatWriter.kt:28)
	at co.touchlab.kermit.BaseLogger.processLog(BaseLogger.kt:55)
	<snip>

Should it be changed to catch all Throwable? Or add a specific catch UnsatisfiedLinkError?

I'm on version 2.1.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions