crebuh crebuh - 10 days ago 6x
Android Question

Angular2 + Cordova - Cannot match any routes on startup

I've got a problem with a Angular2 app, when I build it for Android (maybe this problem also occurs on iOS, but I didn't tested it yet). On startup I get the following error message:

EXCEPTION: Error: Uncaught (in promise): Cannot match any routes. Current segment: 'android_asset'. Available routes: ['', '/login', '/register', '/lostpw', '/resetpw', '/content'].

Due to that the startpage of the app fails to load. To make the app running at all I had to replace the base-tag in the index.html from

<base href="/">


<base href="file:///android_asset/www/" target="_blank">

But as said, now the router tries to resolve android_asset. With in the app I can click on a menu-entry like

<a [routerLink]="['/']">Home</a>

and I am successfully redirected to the home route.

Does anybody know how to solve the problem on the startup?

Version: Angular 2.0.0-rc.1

kTn kTn

For '' redirct to home

export const StartRoutes: RouterConfig = [ { path: '', redirectTo: '/home' } ];