As the title says. When using the console of AndroidStudio on my app it shows:
W/System: A resource failed to call release.
Sometimes it is said multiple ti
This message comes from dalvik.system.CloseGuard
. When debugging, you can set it up to create stack traces as you create resources, so that you can track down what objects aren't being closed.
It's not part of the framework API, so I'm using reflection to turn that on:
try {
Class.forName("dalvik.system.CloseGuard")
.getMethod("setEnabled", boolean.class)
.invoke(null, true);
} catch (ReflectiveOperationException e) {
throw new RuntimeException(e);
}
more info: https://wh0.github.io/2020/08/12/closeguard.html