android-没有特定原因获取nullpointerexception [英] android - getting nullpointerexception for no specific reason
问题描述
我正在研究一个android项目,据我所知,我没有在代码中犯任何会导致异常的特定错误.
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.
NullPointerException 没有具体的发生位置,这使我感到困惑.
The NullPointerException doesn't have a concrete occurance location, which confuses me.
我已经搜索了类似的问题.一种可能的解决方案是在我的Android清单文件中添加READ_EXTERNAL_STORAGE和WRITE_EXTERNAL_STORAGE作为使用权限,但无济于事.
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
推荐答案
我的OnePlus抛出了错误,在android模拟器上没有显示错误
The error was thrown by my OnePlus, on the android emulator there was no error shown
这篇关于android-没有特定原因获取nullpointerexception的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!