Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android console displays: W/art: Attempt to remove non-JNI local reference

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?

like image 505
user1532669 Avatar asked Oct 20 '16 04:10

user1532669


1 Answers

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.

like image 109
Samuel Peter Avatar answered Sep 28 '22 01:09

Samuel Peter