I've just setup my first Cordova project and installed OneSignal push notifications. This is all working as I expect, however the Android Developer Tools are showing this in the console:
W/art: Attempt to remove non-JNI local reference, dumping thread W/art: Attempt to remove non-JNI local reference, dumping thread W/art: Attempt to remove non-JNI local reference, dumping thread W/art: Attempt to remove non-JNI local reference, dumping thread W/art: Attempt to remove non-JNI local reference, dumping thread W/art: Attempt to remove non-JNI local reference, dumping thread W/art: Attempt to remove non-JNI local reference, dumping thread W/art: Attempt to remove non-JNI local reference, dumping thread I/art: WaitForGcToComplete blocked for 6.202ms for cause Background W/art: Attempt to remove non-JNI local reference, dumping thread W/art: Attempt to remove non-JNI local reference, dumping thread W/art: Attempt to remove non-JNI local reference, dumping thread W/art: Attempt to remove non-JNI local reference, dumping thread W/art: Attempt to remove non-JNI local reference, dumping thread W/art: Attempt to remove non-JNI local reference, dumping thread W/art: Attempt to remove non-JNI local reference, dumping thread W/art: Attempt to remove non-JNI local reference, dumping thread W/art: Attempt to remove non-JNI local reference, dumping thread W/art: Attempt to remove non-JNI local reference, dumping thread W/art: Attempt to remove non-JNI local reference, dumping thread W/art: Attempt to remove non-JNI local reference, dumping thread W/art: Attempt to remove non-JNI local reference, dumping thread W/art: Attempt to remove non-JNI local reference, dumping thread W/art: Attempt to remove non-JNI local reference, dumping thread W/art: Attempt to remove non-JNI local reference, dumping thread
This message is constantly output while the app is running.
What does it mean and how can I resolve whatever issue there is?
It seems that the problem is related to this Chromium bug. Quoting the bug report:
On recent versions of ART with CheckJNI turned on, this causes a spammy warning to be printed to logcat stating "Attempt to remove non-JNI local reference, dumping thread" with a thread dump, as apparently parameters are not supposed to be deleted, only objects returned as local references from native->java JNI calls. This is not actually a problem since the runtime just does nothing in this case (other than printing the warning), but it's spammy for webview-using applications that may want to run development builds with checkjni enabled.
This is different from the host GPU emulation issue, which would crash the app instead of letting it run with spammy warnings.
I've looked quite a bit, but couldn't find a way to disable CheckJNI on ART (even though it is possible for Dalvik). My current workaround is to filter the logcat. To do this, select the text of the warning in the logcat window of Android Studio, then right click it and choose Fold lines like this
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With