1

I am developing an app that has a lot of forms for users to enter the data, but right out of nowhere I started getting DeadObjectException crash.

I am suspecting that it might be related to the keyboard, but I am not sure.

Here is the exception:

W/WindowManager: Failed to deliver inset state change to w=Window{a1dbe25 u0 com.myapp.test/com.myapp.test.units.UnitsActivity}
    android.os.DeadObjectException
        at android.os.BinderProxy.transactNative(Native Method)
        at android.os.BinderProxy.transact(BinderProxy.java:540)
        at android.view.IWindow$Stub$Proxy.insetsControlChanged(IWindow.java:765)
        at com.android.server.wm.WindowState.notifyInsetsControlChanged(WindowState.java:3582)
        at com.android.server.wm.InsetsStateController.lambda$notifyPendingInsetsControlChanged$4$InsetsStateController(InsetsStateController.java:428)
        at com.android.server.wm.-$$Lambda$InsetsStateController$-1iOXDf-1s3wDHcMIHBKNk6MS3I.run(Unknown Source:2)
        at com.android.server.wm.WindowAnimator.executeAfterPrepareSurfacesRunnables(WindowAnimator.java:323)
        at com.android.server.wm.WindowAnimator.animate(WindowAnimator.java:204)
        at com.android.server.wm.WindowAnimator.lambda$new$1$WindowAnimator(WindowAnimator.java:100)
        at com.android.server.wm.-$$Lambda$WindowAnimator$ddXU8gK8rmDqri0OZVMNa3Y4GHk.doFrame(Unknown Source:2)
        at android.view.Choreographer$CallbackRecord.run(Choreographer.java:970)
        at android.view.Choreographer.doCallbacks(Choreographer.java:796)
        at android.view.Choreographer.doFrame(Choreographer.java:727)
        at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:957)
        at android.os.Handler.handleCallback(Handler.java:938)
        at android.os.Handler.dispatchMessage(Handler.java:99)
        at android.os.Looper.loop(Looper.java:223)
        at android.os.HandlerThread.run(HandlerThread.java:67)
        at com.android.server.ServiceThread.run(ServiceThread.java:44)

EDIT:

  public static int getAppVersionCode(Context context){
    try {
      PackageInfo pInfo = context.getPackageManager().getPackageInfo(context.getPackageName(), 0);
      return pInfo.versionCode;
    } catch (PackageManager.NameNotFoundException e) {
      e.printStackTrace();
    }
    return 1;
  }
Zookey
  • 2,637
  • 13
  • 46
  • 80
  • Are you perhaps using PackageManager in your app? – Dan Baruch Nov 12 '20 at 14:05
  • Yes, I have it to check the app version. I will edit the question. – Zookey Nov 12 '20 at 14:08
  • I once used this object in an app I made, and after abusing it a lot I got this error as well. How many times are you calling this check? if it's a lot of times (or in general, if you are using PackageManager a lot of times) it can cause that. Is it any relevant to your case? – Dan Baruch Nov 12 '20 at 14:11
  • I just added my own log print to the catch bloc, but it did not get to print anything here. Yes, I am using it on every app run, to check the app version, since I have some limitation by app versions. – Zookey Nov 12 '20 at 14:13
  • No, I'm talking about using it multiple times in a single run. If you close and open your app again it doesn't count. Seems that it's not relevant to your case as you would only check for the version few times – Dan Baruch Nov 12 '20 at 14:14
  • Actually it is onResume() of one MainActivity, but still the crash happens randomly on a lot of other screens – Zookey Nov 12 '20 at 14:17
  • Let us [continue this discussion in chat](https://chat.stackoverflow.com/rooms/224471/discussion-between-dan-baruch-and-zookey). – Dan Baruch Nov 12 '20 at 14:18
  • Does this answer your question? [GetPackageInfo results in DeadObjectException](https://stackoverflow.com/questions/55263437/getpackageinfo-results-in-deadobjectexception) – JensV Nov 12 '20 at 14:29
  • It seems that is not the problem. I have disabled that call, but it still crashes. I am suspecting that it might be something related to the keyboard, but not sure why. – Zookey Nov 12 '20 at 14:36
  • Is this any help: https://stackoverflow.com/questions/21826670/deadobjectexception-on-android-app ? – Dan Baruch Nov 12 '20 at 14:37
  • I will try thatt. It is interesting that it only happens on Android Emulator with API 30 so far. I do not have not tested on the device with API 30. – Zookey Nov 12 '20 at 14:52

0 Answers0