目录

What should I do if error messages related to stack trace analysis for release applications are displayed?

The following table lists the solutions to the errors that may be reported when you use stack trace analysis for release applications.

Error

Cause

Solution

Incorrect path format in line X

The stack trace analysis function identifies the stack trace (path:row number:column number) as the ArkTS stack trace for analyzing, and further verifies that the stack trace path does not contain invalid characters in the running system. If the stack trace does not meet the preceding format, the error message "Incorrect path format in line X" is displayed.

Check whether the stack trace meets the (path:row number:column number) format. If not, modify the stack trace and parse it again.

Failed to find the source file in line X

If Unscramble stack trace is not selected, the stack trace generated by the current project is used by default. The file required for analysis is obtained from the current project, and the analysis result also searches for the source file from the current project. If the source file does not exist, the error message "Failed to find the source file in line X" is displayed.

If Unscramble stack trace is selected, the ArkTS stack trace analysis result is a relative path and does not search for the source file. If the .so analysis result does not exist, the error message "Failed to find the source file in line X" is displayed.

If the analysis result does not contain an absolute path, run the file command to check whether the .so file contains debuginfo.

Check whether the project of the stack trace is the same as the opened project and whether the source file of the stack trace exists.

If the .so file is provided by Huawei, make sure this file is the one that generates the current stack trace.

SourceMap error in line X

When parsing stack trace information, DevEco Studio needs the sourceMap to map the bundle file information in the stack trace to the source code information. If the corresponding sourceMap is not provided, if the sourceMap file is inconsistent, or if the stack trace has been modified, leading to a mismatch between the stack trace and the sourceMap, the stack information cannot be mapped correctly to the source code.

In such cases, you may encounter the error message "SourceMap error in line X."

Make sure the bundle file in the currently opened project matches the one used to generate the stack trace. If they do not match, use the source code from when the stack trace was generated to rebuild the release version of the application, and then try parsing the stack trace again.

For a stack trace generated using the FA model, leave Unscramble stack trace deselected for the project. If Unscramble stack trace is selected, the stack trace cannot match the source code information.

So Error in Line X

During stack trace analysis, DevEco Studio needs to use the .so file to map the stack trace to source code information. If the .so file is not provided, the mapping may fail. The error message "So error in Line X" is displayed.

Provide the .so file for the stack and ensure that the .so file contains symbol information. Run the file command to check whether the .so file is not striped. If the.so file is striped, the.so file information is cleared. To avoid this, you can set the strip field in debugSymbol to false in the module-level build-profile.json5 file.

Failed to find source data in line X

If the input stack trace contains the string "Cannot get SourceMap info, dump raw stack:", DevEco Studio replaces the line where the string is located with "Error Line: + Source code corresponding to the first successfully analyzed stack trace".

If the source code corresponding to the first successfully analyzed stack trace does not exist (for example, the source code may have been modified), the error message "Failed to find source data in line X: "is displayed.

Check whether the source code exists. If not, change the source code file to that of the stack trace information.

Failed to find the bundle file in line X

If Unscramble stack trace is not selected, the stack trace analysis function can be used only when the project is opened and the build mode of the application is release.

For the input stack trace information, DevEco Studio searches for the bundle file of the release build corresponding to the stack trace, based on the path conversion rule of the corresponding project type. If the bundle file for the converted path does not exist, the error message "Failed to find the bundle file in line X: " is displayed.

Open the project, build the release app, and enter the stack trace again for analysis.