The use scenarios and priorities of the two files are different.
- The app.json5 file is used to define the global configuration of an application, including the bundle name, vendor, and version number. When this file is used for global configuration, its configuration will be overwritten by the configuration in the build-profile.json5 file with the same bundle name.
- The project-level build-profile.json5 file is used to define the configuration related to build and deployment, including metadata such as the bundle name and version number. If the app.json5 file defines a configuration item with the same bundle name as that in the build-profile.json5 file, the configuration item in the build-profile.json5 file overwrites that in the app.json5 file.
You are advised to configure the project-level build-profile.json5 file. During the build and deployment, the system preferentially uses the configuration in the project-level build-profile.json5 file.
Reference
Tags in the app.json5 Configuration File