sapui5cloud-foundrysap-fiorisap-business-technology-platformui5-tooling

Why changing just the `sap.app/id` in the manifest.json causes app to crash?


I have a SAP CAP Full Stack app. I also have some custom UI5 code - XML Views and JS controllers.

Everything is working fine, but if I just change the sap.app/id section in the manifest.json file (changing from test.reporting.app to test.reporting.app.predev), I start to get errors when open the app in SAP Build Work Zone. The error is:

Error: resource test/reporting/app/view/App.view.xml could not be loaded from https://sapui5.hana.ondemand.com/1.123.2/resources/test-reporting-app/view/App.view.xml. Check for 'file not found' or parse errors.

What is strange is; when I locate the app in the HTML5 Applications in the BTP Cockpit, and open it, it loads just fine. So only when I open the app in SAP Build Work Zone, the error is reported.

Note: After the deployment, I did the update/reload of the content of the HTML5 Apps in the SAP Build Work Zone.

Any ideas why just changing the sap.app/id caused this error?

This is my manifest.json:

{
  "_version": "1.49.0",
  "sap.app": {
    "id": "test.reporting.app.predev",
    "type": "application",
    "...": "..."
  },
  "sap.ui5": {
    "rootView": {
      "viewName": "test.reporting.app.view.App",
      "type": "XML",
      "async": true,
      "id": "app"
    },
    "routing": {
      "config": {
        "routerClass": "sap.m.routing.Router",
        "type": "View",
        "viewType": "XML", 
        "path": "test.reporting.app.view",
        "controlId": "app",
        "controlAggregation": "pages",
        "async": true
      },
      "..." "..."
    },
    "...": ".."
  }
}

Solution

  • Does the description of the /sap.app/id section from the documentation Descriptor for Applications, Components, and Libraries (manifest.json) help?

    A mandatory attribute that has to be provided in dot notation [...] must be unique in the system. It must match the namespace provided in the corresponding Component.js.".

    I.e. changing the /sap.app/id value to "test.reporting.app.predev" requires the app Component.js name to be changed also:

    return UIComponent.extend("test.reporting.app.predev.Component", {/*...*/});

    Also other manifest.json sections containing the previous "test.reporting.app" should be changed to "test.reporting.app.predev" too such as in /sap.ui5/rootView and /sap.ui5/routing/config.

    "sap.ui5": {
      "rootView": {
        "viewName": "test.reporting.app.predev.view.App"
      ...
      "config": {
        "path": "test.reporting.app.predev.view"

    Missing this will cause your app resources such as the view/App.view.xml to load based on the default URL prefix, which is the SAPUI5 resource path (The baseUrl in sap.ui.loader.config).

    You'll have to adjust the controllerName in views and the names in *.controller.js as well — basically, everywhere where "test.reporting.app" occurs in your app project (except for the /sap.ui5/componentName if it exists which refers to the ID of the base app).

    <mvc:View controllName="test.reporting.app.predev.controller.App">
    return Controller.extend("test.reporting.app.predev.controller.App", {/*...*/});

    Make sure to change also the UI5 Tooling section name in ui5*.yaml files:

    metadata:
      name: test.reporting.app.predev