简体   繁体   English

致命异常:Thread-5,空指针Object.getClass()

[英]Fatal exception: Thread-5 , nullpointer Object.getClass()

The activity where lies the problem in app works fine for a moment, but at one moment (after clicking on same list that didn't cause the app to crash at the begining) it crashes ..and i get this in my logcat ..can't understand why? 应用程序中存在问题的活动暂时可以正常运行,但是有一段时间(单击相同的列表(在开始时并未导致应用程序崩溃)之后)它崩溃了..而我在logcat中得到了这个。不明白为什么? I've searched on internet for similar cases but with no luck ..( i did found similar exception but not for same cause) ..if you want my java classes..i'll post them .. PS: this is the only code red after the begininng of crash 我在互联网上搜索了类似的案例,但是没有运气..(我确实发现了类似的异常,但原因不相同)..如果您想要我的Java类..我将它们发布.. PS:这是唯一的崩溃开始后的红色代码

   --------- beginning of crash
    09-03 21:01:44.672 7515-7580/ma.ac.iav.menunaviagtion E/AndroidRuntime: FATAL EXCEPTION: Thread-5
        Process: ma.ac.iav.menunaviagtion, PID: 7515
        java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.Class java.lang.Object.getClass()' on a null object reference
            at com.android.tools.profiler.support.profilers.EventProfiler$InputConnectionHandler.run(EventProfiler.java:285)
            at java.lang.Thread.run(Thread.java:764)

The stacktrace suggests that the problem is caused by the Profiler . 堆栈跟踪表明问题是由探查器引起的。

Disabling the profiling and it should work. 禁用性能分析,它应该可以工作。 You can disable profiling by clicking end session in the profiler tab or by disconnecting the usb cable (when you have a real device). 您可以通过单击“探查器”选项卡中的结束会话或断开USB电缆(当您使用真实设备时)来禁用性能分析。

This error will likely be fixed in future versions ov Android Studio, so make sure to update you IDE. 该错误可能会在Android Studio的将来版本中得到修复,因此请确保更新您的IDE。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM