看起来像这样的例外令人困惑:
FATAL EXCEPTION: main java.lang.NullPointerException at android.os.Parcel.readException(Parcel.java:1437) at android.os.Parcel.readException(Parcel.java:1385) at com.yourpackage.ipc.IYourClass$Stub$Proxy.yourMethod(IYourClass.java:488) at com.yourpackage.ipc.YourClassShim.yourMethod(YourClassShim.java:269)
我找到了一堆相关的问题,但没有一个回答“你如何调试这个”.所以我正在提出这个问题/答案.
通过查看android源码here和here,你会发现它可以抛出任何这些(NullPointerException就是我所拥有的):
SecurityException(msg); BadParcelableException(msg); IllegalArgumentException(msg); NullPointerException(msg); IllegalStateException(msg); RuntimeException("Unknown exception code: " + code + " msg " + msg);
但究竟是什么导致了这些?