Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Could not read input channel file descriptors from parcel crash report

Tags:

android

I receiving constant this crash report from my android app:

java.lang.RuntimeException: Could not read input channel file descriptors from parcel.
at android.view.InputChannel.nativeReadFromParcel(Native Method)
at android.view.InputChannel.readFromParcel(InputChannel.java:148)
at android.view.InputChannel$1.createFromParcel(InputChannel.java:39)
at android.view.InputChannel$1.createFromParcel(InputChannel.java:36)
at com.android.internal.view.InputBindResult.<init>(InputBindResult.java:62)
at com.android.internal.view.InputBindResult$1.createFromParcel(InputBindResult.java:102)
at com.android.internal.view.InputBindResult$1.createFromParcel(InputBindResult.java:99)
at com.android.internal.view.IInputMethodManager$Stub$Proxy.startInput(IInputMethodManager.java:709)
at android.view.inputmethod.InputMethodManager.startInputInner(InputMethodManager.java:1296)
at android.view.inputmethod.InputMethodManager.checkFocus(InputMethodManager.java:1418)
at android.view.ViewRootImpl$ViewRootHandler.handleMessage(ViewRootImpl.java:3648)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:157)
at android.app.ActivityThread.main(ActivityThread.java:5356)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1265)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1081)
at dalvik.system.NativeStart.main(Native Method)

I didn't understand what is this error? What can be cause this?

like image 287
Serkay Sarıman Avatar asked Dec 19 '22 09:12

Serkay Sarıman


1 Answers

I had same error. It absolutely disappeared after I cleaned all the memory leaks. Also disappeared java.lang.IllegalStateException: eglMakeCurrent failed EGL_BAD_ALLOC. Memory leak in Java means that Garbage Colector can't clean objects - there are some cross references. And there are some often reasons that I know:

  1. Some uncleared object of class with complex structure (like trees with cross references on parent and its child). So after using that you should call close, destroy or some another method.

  2. Unstatic inner (anonymous) classes in your Activity class - as I understand, inner class always contains reference to its parent, so after finishing activity reference from inner class still exists and GC can't clean them. If you need it in Activity, always create static class (when you want to use refence to YourActivity object, use WeakReference <YourActivty> - it doesn't make a sence for GC and memory leaks doesn't appears, but you should always check for weakReference.get() != null).

  3. References to inner View in your Activity class field. It's better not to use them and always get a reference from findViewByID, but you can just set all this fields to null in onDestroy() method.

For searching some leaks I used Memory Analysis perspective in Eclipse.

like image 168
Ircover Avatar answered Apr 07 '23 07:04

Ircover