Question:
Why does the "Failure [ERROR_BUNDLE_PATH_OR_FILE]" error occur during run/debug?
Answer:
This error occurs when the path of the Hap package is incorrect or when the folder containing the Hap package does not have the necessary access permissions. Below are the possible causes:
- Incorrect Hap Package Path: The path specified for the Hap package is invalid or incorrect.
- Insufficient Folder Permissions: The folder where the Hap package is located does not have the required permissions to be accessed.
Solution:
To resolve this issue, follow these steps:
- Check Hap Package Path: Verify that the Hap package path is correct. Ensure there are no typos or errors in the path.
- Ensure Folder Permissions: Check that the folder containing the Hap package has the appropriate permissions for access. You may need to adjust the folder’s permissions if necessary.
-
Use HDC Tool to Check ApiVersion:
If the issue persists, use the HDC (Huawei Developer Console) tool to query the ApiVersion of the device.
- Run the following command:
hdc shell getprop hw_sc.build.os.apiversion - If the ApiVersion is earlier than the
compileSdkVersionspecified in yourbuild.gradle, you can either upgrade the device to a higher version or modify thecompileSdkVersionandcompatibleSdkVersionvalues in thebuild.gradlefile to be ≤ ApiVersion of the current device.
- Run the following command:
Analysis Conclusion:
The error is likely caused by either an incorrect path to the Hap package or insufficient folder permissions. Verifying the path and ensuring proper access permissions should resolve the issue. Additionally, if the device's ApiVersion is outdated, adjusting the SDK versions in the build.gradle file may help.
Top comments (0)