目录

Syntax Error Codes

00305001 ArkTS Syntax Check Error

Error Message

ArkTS lint errors.

Symptom

An error is reported during ArkTS syntax check.

Possible Causes

The ArkTS syntax is incorrect.

Solution

Rectify the ArkTS syntax error based on the error message.

00305003 Type Errors Detected in hvigorfile.ts or hvigorconfig.ts

Error Message

There are these type errors in the code.

Symptom

A type error occurs when hvigorfile.ts or hvigorconfig.ts is parsed.

Possible Causes

Type errors are detected in hvigorfile.ts or hvigorconfig.ts.

Solution

Rectify the type error in the hvigorfile.ts or hvigorconfig.ts file based on the error message.

00305004 Syntax Error Detected in the JSON/JSON5 File

Error Message

The error message is subject to the actual syntax error.

Symptom

A syntax error occurs when the JSON or JSON5 file is parsed.

Possible Causes

  1. The JSON or JSON5 file contains syntax errors.
  2. The file is encrypted or modified by security software.

Solution

  1. Rectify the syntax error in the file based on the error message.
  2. Check whether the file is encrypted or modified by security software.

00305006 Incorrect JSON/JSON5 Format

Error Message

XXX is not the correct JSON/JSON5 format.

Symptom

XXX is not in the correct JSON/JSON5 format.

Possible Causes

  1. The file is not in JSON or JSON5 format.
  2. The file is encrypted or modified by security software.

Solution

  1. Ensure that the file is in JSON or JSON5 format.
  2. Check whether the file is encrypted or modified by security software.

00305007 Incorrect JSON/JSON5 Format

Error Message

XXX is not the correct JSON/JSON5 format.

Symptom

XXX is not in the correct JSON/JSON5 format.

Possible Causes

  1. The file is not in JSON or JSON5 format.
  2. The file is encrypted or modified by security software.

Solution

  1. Ensure that the file is in JSON or JSON5 format.
  2. Check whether the file is encrypted or modified by security software.

00305008 Syntax Error in the JSON/JSON5 File

Error Message

XXX at file: YYY:ZZZ.

Symptom

A syntax error exists in the file at the given position.

Possible Causes

  1. The file contains JSON or JSON5 syntax errors.
  2. The file is encrypted or modified by security software.

Solution

  1. Fix the JSON or JSON5 syntax errors based on the file path in the error message.
  2. Check whether the file is encrypted or modified by security software.

00305009 CMake File API Parsing Failure

Error Message

CMake file API parse failed. At file: XXX.

Symptom

The metadata files generated by CMake File API fail to be parsed.

Possible Causes

The files starting with index- cannot be found in the XXX directory.

Solution

Choose Build > Clean Project on the menu bar and rebuild the project.

00305010 Undefined Attribute or Method

Error Message

The actual error message prevails.

Symptom

The attribute or method is not defined.

Possible Causes

An undefined attribute or method is used in hvigorconfig.ts or hvigorfile.ts.

Solution

Define the attributes or methods used in hvigorconfig.ts or hvigorfile.ts.

00305011 Undefined Symbol

Error Message

A 'undefined symbol' error has occurred.

Symptom

Undefined symbol errors occur.

Possible Causes

Source files are not compiled or linked correctly, or the necessary library files are missing.

Solution

For details, see How do I resolve the "A 'undefined symbol' error has occurred" error during C++ compilation?.

00305012 CMake Task Execution Failure

Error Message

CMake task execution failed.

Symptom

A CMake task failed to be executed.

Possible Causes

The .cxx directory is manually removed from the module directory after compilation, and query parameters such as --version, --help, and --usage are configured under the arguments field in the build-profile.json5 file.

Solution

Delete query parameters such as --version, --help, and --usage from the arguments field.

00305013 Invalid Tag Exists

Error Message

Invalid tag XXX at YYY.

Symptom

An invalid tag exists.

Possible Causes

The tag in the YYY file contains characters that do not meet the requirements.

Solution

Configure the tag to start with a letter or digit, be no more than 60 characters in length, and consist only of letters, digits, periods (.), hyphens (-), and underscores (_). The tag cannot be set to latest.

00305014 Unknown Error

Error Message

A 'unknown type name' error has occurred.

Symptom

An "unknown type name" error occurs.

Possible Causes

The type is not defined, the relevant header file is not included, or the header file path is incorrect in the code.

Solution

Rectify the fault by referring to How do I resolve the "A 'unknown type name' error has occurred" error during C++ compilation?.

00305015 Parsing Error

Error Message

The actual error message prevails.

Symptom

The actual symptom prevails.

Possible Causes

The path in the source file is incorrectly resolved.

Solution

Fix the error based on the error message.