Skip to Content

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

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

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)
Add a comment
10|10000 characters needed characters exceeded

Related questions

2 Answers

  • Best Answer
    Posted on Jul 26, 2020 at 01:06 AM

    remove the createContent method.

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Jul 26, 2020 at 10:06 AM

    Looking at your routing config,,you wanted to create master detail view app so use SplitApp instead of App.

    in App.View.xml file,

    remove this line <App id=“app”></App>
    And add <SplitApp id=“app”></SplitApp>

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.