N
N
neitoo2022-04-09 15:30:45
Android
neitoo, 2022-04-09 15:30:45

How to find the place in the code where the error occurred?

When I click on the button, the activity crashes and errors appear in the logcat:

2022-04-09 17:25:44.566 21747-21747/? E/u.homebuy.neit: Unknown bits set in runtime_flags: 0x8000
2022-04-09 17:25:45.262 21747-21786/ru.homebuy.neit E/Perf: Fail to get file list ru.homebuy.neito
2022-04-09 17:25:45.262 21747-21786/ru.homebuy.neit E/Perf: getFolderSize() : Exception_1 = java.lang.NullPointerException: Attempt to get length of null array


How to find these errors in the code?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
N
neuralnetwork2020, 2022-04-11
@neitoo

1) Open Logcat in Android Studio
2) run the program
3) perform actions in the program leading to an error

A
AlexVWill, 2022-04-09
@AlexVWill

Load the code into some IDE, for example, Android Studio, run it in debug mode, raise an error, and look at the description of the error in the debugger console.
Judging by what you wrote, the program was written by a crooked programmer who wrote the code in such a way that he tries to get the size of an array without first making sure that it exists and that it is not zero.

L
LittleBob, 2022-04-09
@LittleBob

After all, you have written in the logs: Attempt to get length of null array, an attempt to get the size of a null array. In theory, the line should be indicated further in the logs, but it’s clear that you are working with the array incorrectly somewhere.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question