Skip to Content
0
Jul 25, 2020 at 09:44 PM

SAP UI5 Routing Error : Control with ID app could not be found

469 Views

Hi Experts ,

I am getting Control with ID app could not be found error when starting my app. I tried to check the forum and seen similar issue but nit doesn't solve the issue based on recommendation from other threads.

Error :

Log-dbg.js:456 2020-07-25 17:32:04.146040 Control with ID app could not be found - EventProvider sap.m.routing.Target

Target-dbg.js:29 Uncaught TypeError: Cannot read property 'oTargetControl' of undefined

Folder structure :

FYI ( so that it is not confusing ) You can ignore JS views as I am not using them and only using XML views

App View with id "app", this matches in the routing section of manifest as rootView with id

Index.html

Component.js

Based on debugging the issue is when it triggers routing initialization and tries to load the rootView which is the App view.

the strange part is it could not find id app despite of the fact that the App.view has the id app.

Manifest ( showing rootView ) :

{ "_version": "1.1.0", "sap.app": { "_version": "1.1.0", "id": "sapui5.demo.mvcapp", "type": "application", "i18n": "i18n/i18n.properties", "applicationVersion": { "version": "1.0.0" }, "title": "{{appTitle}}", "description": "{{appDescription}}", "dataSources": { "mainService": { "uri": "./service/data.json", "type": "JSON" } } }, "sap.ui": { "_version": "1.1.0", "technology": "UI5", "deviceTypes": { "desktop": true, "tablet": true, "phone": true }, "supportedThemes": [ "sap_bluecrystal" ] }, "sap.ui5": { "_version": "1.1.0", "rootView": { "viewName": "sapui5.demo.mvcapp.view.App", "type": "XML" }, "dependencies": { "minUI5Version": "1.30.0", "libs": { "sap.m": {} } }, "contentDensities": { "compact": true, "cozy": true }, "models": { "": { "dataSource": "mainService" }, "i18n": { "type": "sap.ui.model.resource.ResourceModel", "settings": { "bundleName": "sapui5.demo.mvcapp.i18n.i18n" } } }, "routing": { "config": { "routerClass": "sap.m.routing.Router", "viewType": "XML", "viewPath": "sapui5.demo.mvcapp.view", "controlId": "app", "controlAggregation": "pages", "bypassed": { "target": "notFound" } }, "routes": [ { "pattern": "", "name": "master", "target": "master" }], "targets": { "master": { "viewName": "Master", "viewLevel": 1 }, "detail": { "viewName": "Detail", "viewLevel": 2 }, "notFound": { "viewName": "NotFound", "viewId": "notFound" } } }

Can you let me know what am I missing in the code to display the app view.

Thanks

Govind Parmar

Attachments

janhx.png (14.6 kB)
95rxy.png (12.6 kB)
sitds.png (28.7 kB)
eji5g.png (52.7 kB)
sjp2a.png (49.0 kB)