android - getting nullpointerexception for no specific reason

馋奶兔 提交于 2020-11-29 03:07:56

问题


I am working on an android project and as far as I know, I don't make any specific mistakes in my code that would lead to an exception.

I get these two error lines everytime I run my project, but the rest of my code runs without any issues.

The NullPointerException doesn't have a concrete occurance location, which confuses me.

I have already searched for similar issues. A possible solution was adding the READ_EXTERNAL_STORAGE and WRITE_EXTERNAL_STORAGE as uses-permission in my Android Manifest file, but to no avail.

2020-02-28 XX:XX:XX.333 14615-14651/com.example.package_name E/Perf: Fail to get file list com.example.package_name
2020-02-28 XX:XX:XX.333 14615-14651/com.example.package_name E/Perf: getFolderSize() : Exception_1 = java.lang.NullPointerException: Attempt to get length of null array

回答1:


The error was thrown by my OnePlus, on the android emulator there was no error shown



来源:https://stackoverflow.com/questions/60450949/android-getting-nullpointerexception-for-no-specific-reason

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!