user2094257
user2094257

Reputation: 1715

Nativescript looking for Nativescript-theme-core in the wrong place?

I am busy with a very simple barcode scanner app and getting a strange error after the app gets deployed to a genymotion emulator... It seems like it's looking for the core theme in the wrong place? Any idea why this is happening and how I can try fix it?

my error:

JS: ns-renderer: ERROR BOOTSTRAPPING ANGULAR
JS: ns-renderer: File /data/data/org.nativescript.barcodescanner/files/app/nativescript-theme-core/css/core.dark.css does not exist. Resolved from: nativescript-theme-core/css/core.dark.css.
JS:
JS: Error: File /data/data/org.nativescript.barcodescanner/files/app/nativescript-theme-core/css/core.dark.css does not exist. Resolved from: nativescript-theme-core/css/core.dark.css.
JS:     at FileSystemResourceLoader.get (/data/data/org.nativescript.barcodescanner/files/app/tns_modules/nativescript-angular/resource-loader.js:22:19)
JS:     at DirectiveNormalizer._fetch (/data/data/org.nativescript.barcodescanner/files/app/tns_modules/@angular/compiler/bundles/compiler.umd.js:13661:45)
JS:     at /data/data/org.nativescript.barcodescanner/files/app/tns_modules/@angular/compiler/bundles/compiler.umd.js:13761:55
JS:     at Array.map (native)
JS:     at DirectiveNormalizer._loadMissingExternalStylesheets (/data/data/org.nativescript.barcodescanner/files/app/tns_modules/@angular/compiler/bundles/compiler.umd.js:13761:16)
JS:     at /data/data/org.nativescript.barcodescanner/files/app/tns_modules/@angular/compiler/bundles/compiler.umd.js:13764:28
JS:     at ZoneDelegate.invoke (/data/data/org.nativescript.barcodescanner/files/app/tns_modules/nativescript-angular/zone.js/dist/zone-nativescript.js:190:28)
JS:     at Zone.run (/data/data/org.nativescript.barcodescanner/files/app/tns_modules/nativescript-angular/zone.js/dist/zone-nativescript.js:83:43)
JS:     at /data/data/org.nativescript.barcodescanner/files/app/tns_modules/nativescript-angular/zone.js/dist/zone-nativescript.js:449:57
JS:     at ZoneDelegate.invokeTask (/data/data/org.nativescript.barcodescanner/files/app/tns_modules/nativescript-angular/zone.js/dist/zone-nativescript.js:223:37)

my app.css:

@import 'nativescript-theme-core/css/core.dark.css';

and in my app.component.css:

    styleUrls: ['./app.css']

Upvotes: 0

Views: 585

Answers (1)

Nick Iliev
Nick Iliev

Reputation: 9670

In your app.css you should have

@import 'nativescript-theme-core/css/core.dark.css';

And in your app.component.ts remove the explicit call to app.css. It is not needed as the styles in app.css will be visible globally in your application by default. See this comment for details.

Upvotes: 1

Related Questions