title: sapui5 routing (Can not navigate to route with name xx because the route does not exist)
body: <p>I have 4 views and the main view is the login page. So when user click login button with correct credentials it will redirect to <strong>main</strong> page. But I received an error <strong>Can not navigate to route with name main because the route does not exist</strong></p>
  
  <p>Below is my manifest.json routing config:</p>
  
  <pre><code>    "routing": {
          "config": {
              "routerClass": "sap.m.routing.Router",
              "viewType": "XML",
              "async": true,
              "viewPath": "UI.sap_portal.view",
              "controlAggregation": "pages",
              "controlId": "app",
              "clearControlAggregation": false,
              "transition": "slide" 
          },
          "routes": [
              {
                  "name": "Routemain",
                  "pattern": "Routemain",
                  "target": [
                      "Targetmain"
                  ]
              } 
          ],
          "targets": {
              "Targetmain": {
                  "viewType": "XML",
                  "transition": "slide",
                  "clearControlAggregation": false,
                  "viewId": "login",
                  "viewName": "login",
                  "viewLevel": 1
              },
              "main": {
                  "viewId": "main",
                  "viewType": "XML",
                  "viewName": "main",
                  "viewLevel": 1
              },
              "masterData": {
                  "viewType": "XML",
                  "viewName": "masterData"
              },
              "purchasing": {
                  "viewType": "XML",
                  "viewName": "purchasing"
              } 
          }
      }
  </code></pre>
  
  <p>This is my login.controller.js code:</p>
  
  <pre><code>        var oRouter = sap.ui.core.UIComponent.getRouterFor(this);
          oRouter.navTo("main");
  </code></pre>
  
  <p>If I put this in my manifest.json</p>
  
  <pre><code>        "routes": [
              {
                  "name": "Routemain",
                  "pattern": "Routemain",
                  "target": [
                      "Targetmain"
                  ]
              },
              {
                  "name": "main",
                  "pattern": "",
                  "target": "main"
              }
  
          ]
  </code></pre>
  
  <p>It auto redirect to my main page, it should be login page. Sorry I'm new with sapui5.</p>