NativeScript preview problems











up vote
0
down vote

favorite












I'm new to NativeScript and am checking it out to see if I can convert my Angular project to native. Unfortunately, I can't get it to preview anything. E.g., even a default Angular project created and converted to NS, like below throws errors on both my Android and iOS devices.



ng new Angular
cd Angular
ng add @nativescript/schematics
tns preview


The default project created with NativeScript directly (e.g., tns create NSAngular --ng) previews fine, so it is something to do with projects converted, looks like.



The errors vary and show up on both Linux (Fedora 29) and Windows (10), but they complain about missing app.component.html or not finding module "./" or something else. I can post the entire trace for one of those failures, if that helps, but I'm guessing (and hoping) this is a silly newbie error because even basic things are failing, and I would appreciate any help you could provide. Thanks!



Edit: Here are some logs.



LOG #1



com.tns.NativeScriptException: Application entry point file not found. Please specify the file in package.json otherwise make sure the file index.js or bootstrap.js exists.nIf using typescript make sure your entry point file is transpiled to javascript.
at com.tns.Module.bootstrapApp(Module.java:311)
at com.tns.Runtime.run(Runtime.java:544)
at com.tns.NativeScriptApplication.onCreate(NativeScriptApplication.java:21)
at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1013)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4707)
at android.app.ActivityThread.-wrap1(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1405)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:5417)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
Caused by: com.tns.NativeScriptException: Failed to find module: "./", relative to: app//
at com.tns.Module.resolvePathHelper(Module.java:146)
at com.tns.Module.bootstrapApp(Module.java:309)
... 12 more


LOG #2



2018-11-08 16:37:22.580 nsplaydev[5045:2029563] PlayLiveSync: applicationDidFinishLaunching

2018-11-08 16:37:22.592 nsplaydev[5045:2029563] ***** Fatal JavaScript exception - application has been terminated. *****

2018-11-08 16:37:22.592 nsplaydev[5045:2029563] Native stack trace:

1 0x105533f84 NativeScript::reportFatalErrorBeforeShutdown(JSC::ExecState*, JSC::Exception*, bool, bool)

2 0x105560fdc NativeScript::FFICallback<NativeScript::ObjCMethodCallback>::ffiClosureCallback(ffi_cif*, void*, void**, void*)

3 0x106039578 ffi_closure_SYSV_inner

4 0x10603c1b4 .Ldo_closure

5 0x233de0d14 <redacted>

6 0x233de0ce0 <redacted>

7 0x233de01d0 <redacted>

8 0x233ddfe7c <redacted>

9 0x233d581c0 <redacted>

10 0x233ddf908 _CFXNotificationPost

11 0x2347eeeb0 <redacted>

12 0x260c9d4fc <redacted>

13 0x260ca2e1c <redacted>

14 0x260543c18 <redacted>

15 0x26054c6f0 <redacted>

16 0x260543894 <redacted>

17 0x260544234 <redacted>

18 0x260542334 <redacted>

19 0x260541fe0 <redacted>

20 0x2605471a0 <redacted>

21 0x260548100 _performActionsWithDelayForTransitionContext

22 0x260547058 <redacted>

23 0x26054bd9c <redacted>

24 0x260ca1314 <redacted>

25 0x26088cc34 <redacted>

26 0x2368a3890 <redacted>

27 0x2368ae658 <redacted>

28 0x2368add50 <redacted>

29 0x2338ac484 <redacted>

30 0x2338833f0 <redacted>

31 0x2368e2640 <redacted>

2018-11-08 16:37:22.596 nsplaydev[5045:2029563] JavaScript stack trace:

2018-11-08 16:37:22.596 nsplaydev[5045:2029563] 1 resolve@file:///app/tns_modules/nativescript-angular/resource-loader.js:33:103

2 get@file:///app/tns_modules/nativescript-angular/resource-loader.js:19:40

3 _fetch@file:///app/tns_modules/@angular/compiler/bundles/compiler.umd.js:2465:50

4 _preParseTemplate@file:///app/tns_modules/@angular/compiler/bundles/compiler.umd.js:2504:39

5 normalizeTemplate@file:///app/tns_modules/@angular/compiler/bundles/compiler.umd.js:2492:57

6 loadDirectiveMetadata@file:///app/tns_modules/@angular/compiler/bundles/compiler.umd.js:10395:79

7 @file:///app/tns_modules/@angular/compiler/bundles/compiler.umd.js:23939:80

8 forEach@[native code]

9 @file:///app/tns_modules/@angular/compiler/bundles/compiler.umd.js:23938:83

10 forEach@[native code]

11 _loadModules@file:///app/tns_modules/@angular/compiler/bundles/compiler.umd.js:23935:86

12 _compileModuleAndComponents@file:///app/tns_modules/@angular/compiler/bundles/compiler.umd.js:23913:52

13 compileModuleAsync@file:///app/tns_modules/@angular/compiler/bundles/compiler.umd.js:23873:68

14 bootstrapModule@file:///app/tns_modules/@angular/core/bundles/core.umd.js:4414:47

15 _bootstrapper@file:///app/tns_modules/nativescript-angular/platform-common.js:85:50

16 @file:///app/tns_modules/nativescript-angular/platform-common.js:148:32

17 notify@file:///app/tns_modules/tns-core-modules/data/observable/observable.js:110:31

18 @[native code]

19 notifyAppStarted@file:///app/tns_modules/tns-core-modules/application/application.js:140:36

20 didFinishLaunchingWithOptions@file:///app/tns_modules/tns-core-modules/application/application.js:132:30

21 @[native code]

22 onReceive@file:///app/tns_modules/tns-core-modules/application/application.js:30:32

23 UIApplicationMain@[native code]

24 start@file:///app/tns_modules/tns-core-modules/application/application.js:273:26

25 run@file:///app/tns_modules/tns-core-modules/application/application.js:301:10

26 bootstrapNativeScriptApp@file:///app/tns_modules/nativescript-angular/platform-common.js:185:26

27 bootstrapApp@file:///app/tns_modules/nativescript-angular/platform-common.js:103:38

28 bootstrapModule@file:///app/tns_modules/nativescript-angular/platform-common.js:87:26

29 anonymous@file:///app/main.ns.js:10:57

30 evaluate@[native code]

31 moduleEvaluation@[native code]

32 promiseReactionJob@[native code]

2018-11-08 16:37:22.596 nsplaydev[5045:2029563] JavaScript error:

file:///app/tns_modules/nativescript-angular/resource-loader.js:33:103: JS ERROR Error: Could not resolve app.component.html. Looked for: /var/mobile/Containers/Data/Application/41C1E8E2-EC72-47F0-96A2-68C4A57AD22D/Documents/Playground/LiveSync/app/app.component.html.

2018-11-08 16:37:22.597 nsplaydev[5045:2029563] PlayLiveSync: Uncaught Exception

2018-11-08 16:37:22.598 nsplaydev[5045:2029563] *** JavaScript call stack:

(

0 UIApplicationMain@[native code]

1 start@file:///app/tns_modules/tns-core-modules/application/application.js:273:26

2 run@file:///app/tns_modules/tns-core-modules/application/application.js:301:10

3 bootstrapNativeScriptApp@file:///app/tns_modules/nativescript-angular/platform-common.js:185:26

4 bootstrapApp@file:///app/tns_modules/nativescript-angular/platform-common.js:103:38

5 bootstrapModule@file:///app/tns_modules/nativescript-angular/platform-common.js:87:26

6 anonymous@file:///app/main.ns.js:10:57

7 evaluate@[native code]

8 moduleEvaluation@:1:11

9 promiseReactionJob@:1:11

)

2018-11-08 16:37:22.598 nsplaydev[5045:2029563] *** Terminating app due to uncaught exception 'NativeScript encountered a fatal error: Error: Could not resolve app.component.html. Looked for: /var/mobile/Containers/Data/Application/41C1E8E2-EC72-47F0-96A2-68C4A57AD22D/Documents/Playground/LiveSync/app/app.component.html.

at

1 resolve@file:///app/tns_modules/nativescript-angular/resource-loader.js:33:103

2 get@file:///app/tns_modules/nativescript-angular/resource-loader.js:19:40

3 _fetch@file:///app/tns_modules/@angular/compiler/bundles/compiler.umd.js:2465:50

4 _preParseTemplate@file:///app/tns_modules/@angular/compiler/bundles/compiler.umd.js:2504:39

5 normalizeTemplate@file:///app/tns_modules/@angular/compiler/bundles/compiler.umd.js:2492:57

6 loadDirectiveMetadata@file:///app/tns_modules/@angular/compiler/bundles/compiler.umd.js:10395:79

7 @file:///app/tns_modules/@angular/compiler/bundles/compiler.umd.js:23939:80

8 forEach@[native code]

9 @file:///app/tns_modules/@angular/compiler/bundles/compiler.umd.js:23938:83

10 forEach@[native code]

11 _loadModules@file:///app/tns_modules/@angular/compiler/bundles/compiler.umd.js:23935:86

12 _compileModuleAndComponents@file:///app/tns_modules/@angular/compiler/bundles/compiler.umd.js:23913:52

13 compileModuleAsync@file:///app/tns_modules/@angular/compiler/bundles/compiler.umd.js:23873:68

14 bootstrapModule@file:///app/tns_modules/@angular/core/bundles/core.umd.js:4414:47

15 _bootstrapper@file:///app/tns_modules/nativescript-angular/platform-common.js:85:50

16 @file:///app/tns_modules/nativescript-angular/platform-common.js:148:32

17 notify@file:///app/tns_modules/tns-core-modules/data/observable/observable.js:110:31

18 @[native code]

19 notifyAppStarted@file:///app/tns_modules/tns-core-modules/application/application.js:140:36

20 didFinishLaunchingWithOptions@file:///app/tns_modules/tns-core-modules/application/application.js:132:30

21 @[native code]

22 onReceive@file:///app/tns_modules/tns-core-modules/application/application.js:30:32

23 UIApplicationMain@[native code]

24 start@file:///app/tns_modules/tns-core-modules/application/application.js:273:26

25 run@file:///app/tns_modules/tns-core-modules/application/application.js:301:10

26 bootstrapNativeScriptApp@file:///app/tns_modules/nativescript-angular/platform-common.js:185:26

27 bootstrapApp@file:///app/tns_modules/nativescript-angular/platform-common.js:103:38

28 bootstrapModule@file:///app/tns_modules/nativescript-angular/platform-common.js:87:26

29 anonymous@file:///app/main.ns.js:10:57

30 evaluate@[native code]

31 moduleEvaluation@[native code]

32 promiseReactionJob@[native code]

', reason: '(null)'

*** First throw call stack:

(0x233e73ef8 0x233041a40 0x1055342d4 0x105560fdc 0x106039578 0x10603c1b4 0x233de0d14 0x233de0ce0 0x233de01d0 0x233ddfe7c 0x233d581c0 0x233ddf908 0x2347eeeb0 0x260c9d4fc 0x260ca2e1c 0x260543c18 0x26054c6f0 0x260543894 0x260544234 0x260542334 0x260541fe0 0x2605471a0 0x260548100 0x260547058 0x26054bd9c 0x260ca1314 0x26088cc34 0x2368a3890 0x2368ae658 0x2368add50 0x2338ac484 0x2338833f0 0x2368e2640 0x2368e22cc 0x2368e28e8 0x233e025b8 0x233e02538 0x233e01e1c 0x233dfcce8 0x233dfc5b8 0x236070584 0x260ca4bc8 0x10603c044 0x106038c8c 0x106038750 0x105501740 0x10603780c 0x106036bd0 0x106036bd0 0x106036bd0 0x106036bd0 0x106036bd0 0x106036bd0 0x10602f870 0x105e258d8 0x105df1940 0x105fc4c6c 0x105514414 0x105654f7c 0x1060376e8 0x106036bd0 0x106036bd0 0x10602f870 0x105e258d8 0x105df1940 0x105fc4dbc 0x10564c38c 0x10550ba80 0x10556c5a0 0x1052f0154 0x104d5b4f4 0x2338bcb94)

libc++abi.dylib: terminating with uncaught exception of type NSException

2018-11-08 16:37:22.598 nsplaydev[5045:2029563] PlayLiveSync: Uncaught Exception


LOG #3



An uncaught Exception occurred on "main" thread.
java.lang.RuntimeException: Unable to start activity ComponentInfo{org.nativescript.preview/com.tns.NativeScriptActivity}: com.tns.NativeScriptException:
Calling js method onCreate failed

TypeError: Cannot read property 'create' of undefined
File: "file:///data/data/org.nativescript.preview/files/app/tns_modules/tns-core-modules/ui/builder/builder.js, line: 75, column: 14

StackTrace:
Frame: function:'', file:'file:///data/data/org.nativescript.preview/files/app/tns_modules/tns-core-modules/ui/builder/builder.js', line: 75, column: 15
Frame: function:'FrameBase.navigate', file:'file:///data/data/org.nativescript.preview/files/app/tns_modules/tns-core-modules/ui/frame/frame-common.js', line: 119, column: 30
Frame: function:'ActivityCallbacksImplementation.setActivityContent', file:'file:///data/data/org.nativescript.preview/files/app/tns_modules/tns-core-modules/ui/frame/frame.js', line: 863, column: 30
Frame: function:'ActivityCallbacksImplementation.onCreate', file:'file:///data/data/org.nativescript.preview/files/app/tns_modules/tns-core-modules/ui/frame/frame.js', line: 722, column: 14
Frame: function:'NativeScriptActivity.onCreate', file:'file:///data/data/org.nativescript.preview/files/app/tns_modules/tns-core-modules/ui/frame/activity.js', line: 20, column: 25


at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2416)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2476)
at android.app.ActivityThread.-wrap11(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1344)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:5417)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
Caused by: com.tns.NativeScriptException:
Calling js method onCreate failed

TypeError: Cannot read property 'create' of undefined
File: "file:///data/data/org.nativescript.preview/files/app/tns_modules/tns-core-modules/ui/builder/builder.js, line: 75, column: 14

StackTrace:
Frame: function:'', file:'file:///data/data/org.nativescript.preview/files/app/tns_modules/tns-core-modules/ui/builder/builder.js', line: 75, column: 15
Frame: function:'FrameBase.navigate', file:'file:///data/data/org.nativescript.preview/files/app/tns_modules/tns-core-modules/ui/frame/frame-common.js', line: 119, column: 30
Frame: function:'ActivityCallbacksImplementation.setActivityContent', file:'file:///data/data/org.nativescript.preview/files/app/tns_modules/tns-core-modules/ui/frame/frame.js', line: 863, column: 30
Frame: function:'ActivityCallbacksImplementation.onCreate', file:'file:///data/data/org.nativescript.preview/files/app/tns_modules/tns-core-modules/ui/frame/frame.js', line: 722, column: 14
Frame: function:'NativeScriptActivity.onCreate', file:'file:///data/data/org.nativescript.preview/files/app/tns_modules/tns-core-modules/ui/frame/activity.js', line: 20, column: 25


at com.tns.Runtime.callJSMethodNative(Native Method)
at com.tns.Runtime.dispatchCallJSMethodNative(Runtime.java:1116)
at com.tns.Runtime.callJSMethodImpl(Runtime.java:996)
at com.tns.Runtime.callJSMethod(Runtime.java:983)
at com.tns.Runtime.callJSMethod(Runtime.java:967)
at com.tns.Runtime.callJSMethod(Runtime.java:959)
at com.tns.NativeScriptActivity.onCreate(NativeScriptActivity.java:18)
at android.app.Activity.performCreate(Activity.java:6251)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1107)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2369)
... 9 more









share|improve this question
























  • Yes, please. Post the entire failure log, that might give us some clue.
    – Manoj
    Nov 9 at 16:18










  • Please see, if these instructions help you. docs.nativescript.org/code-sharing/creating-a-new-project
    – Baskar
    Nov 9 at 16:28










  • Thanks Manoj, I've added some traces. Baskar, my goal is to convert an existing Angular project to NS; creating a new one (at least with tns) works fine, but is not useful for me.
    – Sekhar Ravinutala
    Nov 9 at 16:57















up vote
0
down vote

favorite












I'm new to NativeScript and am checking it out to see if I can convert my Angular project to native. Unfortunately, I can't get it to preview anything. E.g., even a default Angular project created and converted to NS, like below throws errors on both my Android and iOS devices.



ng new Angular
cd Angular
ng add @nativescript/schematics
tns preview


The default project created with NativeScript directly (e.g., tns create NSAngular --ng) previews fine, so it is something to do with projects converted, looks like.



The errors vary and show up on both Linux (Fedora 29) and Windows (10), but they complain about missing app.component.html or not finding module "./" or something else. I can post the entire trace for one of those failures, if that helps, but I'm guessing (and hoping) this is a silly newbie error because even basic things are failing, and I would appreciate any help you could provide. Thanks!



Edit: Here are some logs.



LOG #1



com.tns.NativeScriptException: Application entry point file not found. Please specify the file in package.json otherwise make sure the file index.js or bootstrap.js exists.nIf using typescript make sure your entry point file is transpiled to javascript.
at com.tns.Module.bootstrapApp(Module.java:311)
at com.tns.Runtime.run(Runtime.java:544)
at com.tns.NativeScriptApplication.onCreate(NativeScriptApplication.java:21)
at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1013)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4707)
at android.app.ActivityThread.-wrap1(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1405)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:5417)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
Caused by: com.tns.NativeScriptException: Failed to find module: "./", relative to: app//
at com.tns.Module.resolvePathHelper(Module.java:146)
at com.tns.Module.bootstrapApp(Module.java:309)
... 12 more


LOG #2



2018-11-08 16:37:22.580 nsplaydev[5045:2029563] PlayLiveSync: applicationDidFinishLaunching

2018-11-08 16:37:22.592 nsplaydev[5045:2029563] ***** Fatal JavaScript exception - application has been terminated. *****

2018-11-08 16:37:22.592 nsplaydev[5045:2029563] Native stack trace:

1 0x105533f84 NativeScript::reportFatalErrorBeforeShutdown(JSC::ExecState*, JSC::Exception*, bool, bool)

2 0x105560fdc NativeScript::FFICallback<NativeScript::ObjCMethodCallback>::ffiClosureCallback(ffi_cif*, void*, void**, void*)

3 0x106039578 ffi_closure_SYSV_inner

4 0x10603c1b4 .Ldo_closure

5 0x233de0d14 <redacted>

6 0x233de0ce0 <redacted>

7 0x233de01d0 <redacted>

8 0x233ddfe7c <redacted>

9 0x233d581c0 <redacted>

10 0x233ddf908 _CFXNotificationPost

11 0x2347eeeb0 <redacted>

12 0x260c9d4fc <redacted>

13 0x260ca2e1c <redacted>

14 0x260543c18 <redacted>

15 0x26054c6f0 <redacted>

16 0x260543894 <redacted>

17 0x260544234 <redacted>

18 0x260542334 <redacted>

19 0x260541fe0 <redacted>

20 0x2605471a0 <redacted>

21 0x260548100 _performActionsWithDelayForTransitionContext

22 0x260547058 <redacted>

23 0x26054bd9c <redacted>

24 0x260ca1314 <redacted>

25 0x26088cc34 <redacted>

26 0x2368a3890 <redacted>

27 0x2368ae658 <redacted>

28 0x2368add50 <redacted>

29 0x2338ac484 <redacted>

30 0x2338833f0 <redacted>

31 0x2368e2640 <redacted>

2018-11-08 16:37:22.596 nsplaydev[5045:2029563] JavaScript stack trace:

2018-11-08 16:37:22.596 nsplaydev[5045:2029563] 1 resolve@file:///app/tns_modules/nativescript-angular/resource-loader.js:33:103

2 get@file:///app/tns_modules/nativescript-angular/resource-loader.js:19:40

3 _fetch@file:///app/tns_modules/@angular/compiler/bundles/compiler.umd.js:2465:50

4 _preParseTemplate@file:///app/tns_modules/@angular/compiler/bundles/compiler.umd.js:2504:39

5 normalizeTemplate@file:///app/tns_modules/@angular/compiler/bundles/compiler.umd.js:2492:57

6 loadDirectiveMetadata@file:///app/tns_modules/@angular/compiler/bundles/compiler.umd.js:10395:79

7 @file:///app/tns_modules/@angular/compiler/bundles/compiler.umd.js:23939:80

8 forEach@[native code]

9 @file:///app/tns_modules/@angular/compiler/bundles/compiler.umd.js:23938:83

10 forEach@[native code]

11 _loadModules@file:///app/tns_modules/@angular/compiler/bundles/compiler.umd.js:23935:86

12 _compileModuleAndComponents@file:///app/tns_modules/@angular/compiler/bundles/compiler.umd.js:23913:52

13 compileModuleAsync@file:///app/tns_modules/@angular/compiler/bundles/compiler.umd.js:23873:68

14 bootstrapModule@file:///app/tns_modules/@angular/core/bundles/core.umd.js:4414:47

15 _bootstrapper@file:///app/tns_modules/nativescript-angular/platform-common.js:85:50

16 @file:///app/tns_modules/nativescript-angular/platform-common.js:148:32

17 notify@file:///app/tns_modules/tns-core-modules/data/observable/observable.js:110:31

18 @[native code]

19 notifyAppStarted@file:///app/tns_modules/tns-core-modules/application/application.js:140:36

20 didFinishLaunchingWithOptions@file:///app/tns_modules/tns-core-modules/application/application.js:132:30

21 @[native code]

22 onReceive@file:///app/tns_modules/tns-core-modules/application/application.js:30:32

23 UIApplicationMain@[native code]

24 start@file:///app/tns_modules/tns-core-modules/application/application.js:273:26

25 run@file:///app/tns_modules/tns-core-modules/application/application.js:301:10

26 bootstrapNativeScriptApp@file:///app/tns_modules/nativescript-angular/platform-common.js:185:26

27 bootstrapApp@file:///app/tns_modules/nativescript-angular/platform-common.js:103:38

28 bootstrapModule@file:///app/tns_modules/nativescript-angular/platform-common.js:87:26

29 anonymous@file:///app/main.ns.js:10:57

30 evaluate@[native code]

31 moduleEvaluation@[native code]

32 promiseReactionJob@[native code]

2018-11-08 16:37:22.596 nsplaydev[5045:2029563] JavaScript error:

file:///app/tns_modules/nativescript-angular/resource-loader.js:33:103: JS ERROR Error: Could not resolve app.component.html. Looked for: /var/mobile/Containers/Data/Application/41C1E8E2-EC72-47F0-96A2-68C4A57AD22D/Documents/Playground/LiveSync/app/app.component.html.

2018-11-08 16:37:22.597 nsplaydev[5045:2029563] PlayLiveSync: Uncaught Exception

2018-11-08 16:37:22.598 nsplaydev[5045:2029563] *** JavaScript call stack:

(

0 UIApplicationMain@[native code]

1 start@file:///app/tns_modules/tns-core-modules/application/application.js:273:26

2 run@file:///app/tns_modules/tns-core-modules/application/application.js:301:10

3 bootstrapNativeScriptApp@file:///app/tns_modules/nativescript-angular/platform-common.js:185:26

4 bootstrapApp@file:///app/tns_modules/nativescript-angular/platform-common.js:103:38

5 bootstrapModule@file:///app/tns_modules/nativescript-angular/platform-common.js:87:26

6 anonymous@file:///app/main.ns.js:10:57

7 evaluate@[native code]

8 moduleEvaluation@:1:11

9 promiseReactionJob@:1:11

)

2018-11-08 16:37:22.598 nsplaydev[5045:2029563] *** Terminating app due to uncaught exception 'NativeScript encountered a fatal error: Error: Could not resolve app.component.html. Looked for: /var/mobile/Containers/Data/Application/41C1E8E2-EC72-47F0-96A2-68C4A57AD22D/Documents/Playground/LiveSync/app/app.component.html.

at

1 resolve@file:///app/tns_modules/nativescript-angular/resource-loader.js:33:103

2 get@file:///app/tns_modules/nativescript-angular/resource-loader.js:19:40

3 _fetch@file:///app/tns_modules/@angular/compiler/bundles/compiler.umd.js:2465:50

4 _preParseTemplate@file:///app/tns_modules/@angular/compiler/bundles/compiler.umd.js:2504:39

5 normalizeTemplate@file:///app/tns_modules/@angular/compiler/bundles/compiler.umd.js:2492:57

6 loadDirectiveMetadata@file:///app/tns_modules/@angular/compiler/bundles/compiler.umd.js:10395:79

7 @file:///app/tns_modules/@angular/compiler/bundles/compiler.umd.js:23939:80

8 forEach@[native code]

9 @file:///app/tns_modules/@angular/compiler/bundles/compiler.umd.js:23938:83

10 forEach@[native code]

11 _loadModules@file:///app/tns_modules/@angular/compiler/bundles/compiler.umd.js:23935:86

12 _compileModuleAndComponents@file:///app/tns_modules/@angular/compiler/bundles/compiler.umd.js:23913:52

13 compileModuleAsync@file:///app/tns_modules/@angular/compiler/bundles/compiler.umd.js:23873:68

14 bootstrapModule@file:///app/tns_modules/@angular/core/bundles/core.umd.js:4414:47

15 _bootstrapper@file:///app/tns_modules/nativescript-angular/platform-common.js:85:50

16 @file:///app/tns_modules/nativescript-angular/platform-common.js:148:32

17 notify@file:///app/tns_modules/tns-core-modules/data/observable/observable.js:110:31

18 @[native code]

19 notifyAppStarted@file:///app/tns_modules/tns-core-modules/application/application.js:140:36

20 didFinishLaunchingWithOptions@file:///app/tns_modules/tns-core-modules/application/application.js:132:30

21 @[native code]

22 onReceive@file:///app/tns_modules/tns-core-modules/application/application.js:30:32

23 UIApplicationMain@[native code]

24 start@file:///app/tns_modules/tns-core-modules/application/application.js:273:26

25 run@file:///app/tns_modules/tns-core-modules/application/application.js:301:10

26 bootstrapNativeScriptApp@file:///app/tns_modules/nativescript-angular/platform-common.js:185:26

27 bootstrapApp@file:///app/tns_modules/nativescript-angular/platform-common.js:103:38

28 bootstrapModule@file:///app/tns_modules/nativescript-angular/platform-common.js:87:26

29 anonymous@file:///app/main.ns.js:10:57

30 evaluate@[native code]

31 moduleEvaluation@[native code]

32 promiseReactionJob@[native code]

', reason: '(null)'

*** First throw call stack:

(0x233e73ef8 0x233041a40 0x1055342d4 0x105560fdc 0x106039578 0x10603c1b4 0x233de0d14 0x233de0ce0 0x233de01d0 0x233ddfe7c 0x233d581c0 0x233ddf908 0x2347eeeb0 0x260c9d4fc 0x260ca2e1c 0x260543c18 0x26054c6f0 0x260543894 0x260544234 0x260542334 0x260541fe0 0x2605471a0 0x260548100 0x260547058 0x26054bd9c 0x260ca1314 0x26088cc34 0x2368a3890 0x2368ae658 0x2368add50 0x2338ac484 0x2338833f0 0x2368e2640 0x2368e22cc 0x2368e28e8 0x233e025b8 0x233e02538 0x233e01e1c 0x233dfcce8 0x233dfc5b8 0x236070584 0x260ca4bc8 0x10603c044 0x106038c8c 0x106038750 0x105501740 0x10603780c 0x106036bd0 0x106036bd0 0x106036bd0 0x106036bd0 0x106036bd0 0x106036bd0 0x10602f870 0x105e258d8 0x105df1940 0x105fc4c6c 0x105514414 0x105654f7c 0x1060376e8 0x106036bd0 0x106036bd0 0x10602f870 0x105e258d8 0x105df1940 0x105fc4dbc 0x10564c38c 0x10550ba80 0x10556c5a0 0x1052f0154 0x104d5b4f4 0x2338bcb94)

libc++abi.dylib: terminating with uncaught exception of type NSException

2018-11-08 16:37:22.598 nsplaydev[5045:2029563] PlayLiveSync: Uncaught Exception


LOG #3



An uncaught Exception occurred on "main" thread.
java.lang.RuntimeException: Unable to start activity ComponentInfo{org.nativescript.preview/com.tns.NativeScriptActivity}: com.tns.NativeScriptException:
Calling js method onCreate failed

TypeError: Cannot read property 'create' of undefined
File: "file:///data/data/org.nativescript.preview/files/app/tns_modules/tns-core-modules/ui/builder/builder.js, line: 75, column: 14

StackTrace:
Frame: function:'', file:'file:///data/data/org.nativescript.preview/files/app/tns_modules/tns-core-modules/ui/builder/builder.js', line: 75, column: 15
Frame: function:'FrameBase.navigate', file:'file:///data/data/org.nativescript.preview/files/app/tns_modules/tns-core-modules/ui/frame/frame-common.js', line: 119, column: 30
Frame: function:'ActivityCallbacksImplementation.setActivityContent', file:'file:///data/data/org.nativescript.preview/files/app/tns_modules/tns-core-modules/ui/frame/frame.js', line: 863, column: 30
Frame: function:'ActivityCallbacksImplementation.onCreate', file:'file:///data/data/org.nativescript.preview/files/app/tns_modules/tns-core-modules/ui/frame/frame.js', line: 722, column: 14
Frame: function:'NativeScriptActivity.onCreate', file:'file:///data/data/org.nativescript.preview/files/app/tns_modules/tns-core-modules/ui/frame/activity.js', line: 20, column: 25


at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2416)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2476)
at android.app.ActivityThread.-wrap11(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1344)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:5417)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
Caused by: com.tns.NativeScriptException:
Calling js method onCreate failed

TypeError: Cannot read property 'create' of undefined
File: "file:///data/data/org.nativescript.preview/files/app/tns_modules/tns-core-modules/ui/builder/builder.js, line: 75, column: 14

StackTrace:
Frame: function:'', file:'file:///data/data/org.nativescript.preview/files/app/tns_modules/tns-core-modules/ui/builder/builder.js', line: 75, column: 15
Frame: function:'FrameBase.navigate', file:'file:///data/data/org.nativescript.preview/files/app/tns_modules/tns-core-modules/ui/frame/frame-common.js', line: 119, column: 30
Frame: function:'ActivityCallbacksImplementation.setActivityContent', file:'file:///data/data/org.nativescript.preview/files/app/tns_modules/tns-core-modules/ui/frame/frame.js', line: 863, column: 30
Frame: function:'ActivityCallbacksImplementation.onCreate', file:'file:///data/data/org.nativescript.preview/files/app/tns_modules/tns-core-modules/ui/frame/frame.js', line: 722, column: 14
Frame: function:'NativeScriptActivity.onCreate', file:'file:///data/data/org.nativescript.preview/files/app/tns_modules/tns-core-modules/ui/frame/activity.js', line: 20, column: 25


at com.tns.Runtime.callJSMethodNative(Native Method)
at com.tns.Runtime.dispatchCallJSMethodNative(Runtime.java:1116)
at com.tns.Runtime.callJSMethodImpl(Runtime.java:996)
at com.tns.Runtime.callJSMethod(Runtime.java:983)
at com.tns.Runtime.callJSMethod(Runtime.java:967)
at com.tns.Runtime.callJSMethod(Runtime.java:959)
at com.tns.NativeScriptActivity.onCreate(NativeScriptActivity.java:18)
at android.app.Activity.performCreate(Activity.java:6251)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1107)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2369)
... 9 more









share|improve this question
























  • Yes, please. Post the entire failure log, that might give us some clue.
    – Manoj
    Nov 9 at 16:18










  • Please see, if these instructions help you. docs.nativescript.org/code-sharing/creating-a-new-project
    – Baskar
    Nov 9 at 16:28










  • Thanks Manoj, I've added some traces. Baskar, my goal is to convert an existing Angular project to NS; creating a new one (at least with tns) works fine, but is not useful for me.
    – Sekhar Ravinutala
    Nov 9 at 16:57













up vote
0
down vote

favorite









up vote
0
down vote

favorite











I'm new to NativeScript and am checking it out to see if I can convert my Angular project to native. Unfortunately, I can't get it to preview anything. E.g., even a default Angular project created and converted to NS, like below throws errors on both my Android and iOS devices.



ng new Angular
cd Angular
ng add @nativescript/schematics
tns preview


The default project created with NativeScript directly (e.g., tns create NSAngular --ng) previews fine, so it is something to do with projects converted, looks like.



The errors vary and show up on both Linux (Fedora 29) and Windows (10), but they complain about missing app.component.html or not finding module "./" or something else. I can post the entire trace for one of those failures, if that helps, but I'm guessing (and hoping) this is a silly newbie error because even basic things are failing, and I would appreciate any help you could provide. Thanks!



Edit: Here are some logs.



LOG #1



com.tns.NativeScriptException: Application entry point file not found. Please specify the file in package.json otherwise make sure the file index.js or bootstrap.js exists.nIf using typescript make sure your entry point file is transpiled to javascript.
at com.tns.Module.bootstrapApp(Module.java:311)
at com.tns.Runtime.run(Runtime.java:544)
at com.tns.NativeScriptApplication.onCreate(NativeScriptApplication.java:21)
at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1013)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4707)
at android.app.ActivityThread.-wrap1(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1405)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:5417)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
Caused by: com.tns.NativeScriptException: Failed to find module: "./", relative to: app//
at com.tns.Module.resolvePathHelper(Module.java:146)
at com.tns.Module.bootstrapApp(Module.java:309)
... 12 more


LOG #2



2018-11-08 16:37:22.580 nsplaydev[5045:2029563] PlayLiveSync: applicationDidFinishLaunching

2018-11-08 16:37:22.592 nsplaydev[5045:2029563] ***** Fatal JavaScript exception - application has been terminated. *****

2018-11-08 16:37:22.592 nsplaydev[5045:2029563] Native stack trace:

1 0x105533f84 NativeScript::reportFatalErrorBeforeShutdown(JSC::ExecState*, JSC::Exception*, bool, bool)

2 0x105560fdc NativeScript::FFICallback<NativeScript::ObjCMethodCallback>::ffiClosureCallback(ffi_cif*, void*, void**, void*)

3 0x106039578 ffi_closure_SYSV_inner

4 0x10603c1b4 .Ldo_closure

5 0x233de0d14 <redacted>

6 0x233de0ce0 <redacted>

7 0x233de01d0 <redacted>

8 0x233ddfe7c <redacted>

9 0x233d581c0 <redacted>

10 0x233ddf908 _CFXNotificationPost

11 0x2347eeeb0 <redacted>

12 0x260c9d4fc <redacted>

13 0x260ca2e1c <redacted>

14 0x260543c18 <redacted>

15 0x26054c6f0 <redacted>

16 0x260543894 <redacted>

17 0x260544234 <redacted>

18 0x260542334 <redacted>

19 0x260541fe0 <redacted>

20 0x2605471a0 <redacted>

21 0x260548100 _performActionsWithDelayForTransitionContext

22 0x260547058 <redacted>

23 0x26054bd9c <redacted>

24 0x260ca1314 <redacted>

25 0x26088cc34 <redacted>

26 0x2368a3890 <redacted>

27 0x2368ae658 <redacted>

28 0x2368add50 <redacted>

29 0x2338ac484 <redacted>

30 0x2338833f0 <redacted>

31 0x2368e2640 <redacted>

2018-11-08 16:37:22.596 nsplaydev[5045:2029563] JavaScript stack trace:

2018-11-08 16:37:22.596 nsplaydev[5045:2029563] 1 resolve@file:///app/tns_modules/nativescript-angular/resource-loader.js:33:103

2 get@file:///app/tns_modules/nativescript-angular/resource-loader.js:19:40

3 _fetch@file:///app/tns_modules/@angular/compiler/bundles/compiler.umd.js:2465:50

4 _preParseTemplate@file:///app/tns_modules/@angular/compiler/bundles/compiler.umd.js:2504:39

5 normalizeTemplate@file:///app/tns_modules/@angular/compiler/bundles/compiler.umd.js:2492:57

6 loadDirectiveMetadata@file:///app/tns_modules/@angular/compiler/bundles/compiler.umd.js:10395:79

7 @file:///app/tns_modules/@angular/compiler/bundles/compiler.umd.js:23939:80

8 forEach@[native code]

9 @file:///app/tns_modules/@angular/compiler/bundles/compiler.umd.js:23938:83

10 forEach@[native code]

11 _loadModules@file:///app/tns_modules/@angular/compiler/bundles/compiler.umd.js:23935:86

12 _compileModuleAndComponents@file:///app/tns_modules/@angular/compiler/bundles/compiler.umd.js:23913:52

13 compileModuleAsync@file:///app/tns_modules/@angular/compiler/bundles/compiler.umd.js:23873:68

14 bootstrapModule@file:///app/tns_modules/@angular/core/bundles/core.umd.js:4414:47

15 _bootstrapper@file:///app/tns_modules/nativescript-angular/platform-common.js:85:50

16 @file:///app/tns_modules/nativescript-angular/platform-common.js:148:32

17 notify@file:///app/tns_modules/tns-core-modules/data/observable/observable.js:110:31

18 @[native code]

19 notifyAppStarted@file:///app/tns_modules/tns-core-modules/application/application.js:140:36

20 didFinishLaunchingWithOptions@file:///app/tns_modules/tns-core-modules/application/application.js:132:30

21 @[native code]

22 onReceive@file:///app/tns_modules/tns-core-modules/application/application.js:30:32

23 UIApplicationMain@[native code]

24 start@file:///app/tns_modules/tns-core-modules/application/application.js:273:26

25 run@file:///app/tns_modules/tns-core-modules/application/application.js:301:10

26 bootstrapNativeScriptApp@file:///app/tns_modules/nativescript-angular/platform-common.js:185:26

27 bootstrapApp@file:///app/tns_modules/nativescript-angular/platform-common.js:103:38

28 bootstrapModule@file:///app/tns_modules/nativescript-angular/platform-common.js:87:26

29 anonymous@file:///app/main.ns.js:10:57

30 evaluate@[native code]

31 moduleEvaluation@[native code]

32 promiseReactionJob@[native code]

2018-11-08 16:37:22.596 nsplaydev[5045:2029563] JavaScript error:

file:///app/tns_modules/nativescript-angular/resource-loader.js:33:103: JS ERROR Error: Could not resolve app.component.html. Looked for: /var/mobile/Containers/Data/Application/41C1E8E2-EC72-47F0-96A2-68C4A57AD22D/Documents/Playground/LiveSync/app/app.component.html.

2018-11-08 16:37:22.597 nsplaydev[5045:2029563] PlayLiveSync: Uncaught Exception

2018-11-08 16:37:22.598 nsplaydev[5045:2029563] *** JavaScript call stack:

(

0 UIApplicationMain@[native code]

1 start@file:///app/tns_modules/tns-core-modules/application/application.js:273:26

2 run@file:///app/tns_modules/tns-core-modules/application/application.js:301:10

3 bootstrapNativeScriptApp@file:///app/tns_modules/nativescript-angular/platform-common.js:185:26

4 bootstrapApp@file:///app/tns_modules/nativescript-angular/platform-common.js:103:38

5 bootstrapModule@file:///app/tns_modules/nativescript-angular/platform-common.js:87:26

6 anonymous@file:///app/main.ns.js:10:57

7 evaluate@[native code]

8 moduleEvaluation@:1:11

9 promiseReactionJob@:1:11

)

2018-11-08 16:37:22.598 nsplaydev[5045:2029563] *** Terminating app due to uncaught exception 'NativeScript encountered a fatal error: Error: Could not resolve app.component.html. Looked for: /var/mobile/Containers/Data/Application/41C1E8E2-EC72-47F0-96A2-68C4A57AD22D/Documents/Playground/LiveSync/app/app.component.html.

at

1 resolve@file:///app/tns_modules/nativescript-angular/resource-loader.js:33:103

2 get@file:///app/tns_modules/nativescript-angular/resource-loader.js:19:40

3 _fetch@file:///app/tns_modules/@angular/compiler/bundles/compiler.umd.js:2465:50

4 _preParseTemplate@file:///app/tns_modules/@angular/compiler/bundles/compiler.umd.js:2504:39

5 normalizeTemplate@file:///app/tns_modules/@angular/compiler/bundles/compiler.umd.js:2492:57

6 loadDirectiveMetadata@file:///app/tns_modules/@angular/compiler/bundles/compiler.umd.js:10395:79

7 @file:///app/tns_modules/@angular/compiler/bundles/compiler.umd.js:23939:80

8 forEach@[native code]

9 @file:///app/tns_modules/@angular/compiler/bundles/compiler.umd.js:23938:83

10 forEach@[native code]

11 _loadModules@file:///app/tns_modules/@angular/compiler/bundles/compiler.umd.js:23935:86

12 _compileModuleAndComponents@file:///app/tns_modules/@angular/compiler/bundles/compiler.umd.js:23913:52

13 compileModuleAsync@file:///app/tns_modules/@angular/compiler/bundles/compiler.umd.js:23873:68

14 bootstrapModule@file:///app/tns_modules/@angular/core/bundles/core.umd.js:4414:47

15 _bootstrapper@file:///app/tns_modules/nativescript-angular/platform-common.js:85:50

16 @file:///app/tns_modules/nativescript-angular/platform-common.js:148:32

17 notify@file:///app/tns_modules/tns-core-modules/data/observable/observable.js:110:31

18 @[native code]

19 notifyAppStarted@file:///app/tns_modules/tns-core-modules/application/application.js:140:36

20 didFinishLaunchingWithOptions@file:///app/tns_modules/tns-core-modules/application/application.js:132:30

21 @[native code]

22 onReceive@file:///app/tns_modules/tns-core-modules/application/application.js:30:32

23 UIApplicationMain@[native code]

24 start@file:///app/tns_modules/tns-core-modules/application/application.js:273:26

25 run@file:///app/tns_modules/tns-core-modules/application/application.js:301:10

26 bootstrapNativeScriptApp@file:///app/tns_modules/nativescript-angular/platform-common.js:185:26

27 bootstrapApp@file:///app/tns_modules/nativescript-angular/platform-common.js:103:38

28 bootstrapModule@file:///app/tns_modules/nativescript-angular/platform-common.js:87:26

29 anonymous@file:///app/main.ns.js:10:57

30 evaluate@[native code]

31 moduleEvaluation@[native code]

32 promiseReactionJob@[native code]

', reason: '(null)'

*** First throw call stack:

(0x233e73ef8 0x233041a40 0x1055342d4 0x105560fdc 0x106039578 0x10603c1b4 0x233de0d14 0x233de0ce0 0x233de01d0 0x233ddfe7c 0x233d581c0 0x233ddf908 0x2347eeeb0 0x260c9d4fc 0x260ca2e1c 0x260543c18 0x26054c6f0 0x260543894 0x260544234 0x260542334 0x260541fe0 0x2605471a0 0x260548100 0x260547058 0x26054bd9c 0x260ca1314 0x26088cc34 0x2368a3890 0x2368ae658 0x2368add50 0x2338ac484 0x2338833f0 0x2368e2640 0x2368e22cc 0x2368e28e8 0x233e025b8 0x233e02538 0x233e01e1c 0x233dfcce8 0x233dfc5b8 0x236070584 0x260ca4bc8 0x10603c044 0x106038c8c 0x106038750 0x105501740 0x10603780c 0x106036bd0 0x106036bd0 0x106036bd0 0x106036bd0 0x106036bd0 0x106036bd0 0x10602f870 0x105e258d8 0x105df1940 0x105fc4c6c 0x105514414 0x105654f7c 0x1060376e8 0x106036bd0 0x106036bd0 0x10602f870 0x105e258d8 0x105df1940 0x105fc4dbc 0x10564c38c 0x10550ba80 0x10556c5a0 0x1052f0154 0x104d5b4f4 0x2338bcb94)

libc++abi.dylib: terminating with uncaught exception of type NSException

2018-11-08 16:37:22.598 nsplaydev[5045:2029563] PlayLiveSync: Uncaught Exception


LOG #3



An uncaught Exception occurred on "main" thread.
java.lang.RuntimeException: Unable to start activity ComponentInfo{org.nativescript.preview/com.tns.NativeScriptActivity}: com.tns.NativeScriptException:
Calling js method onCreate failed

TypeError: Cannot read property 'create' of undefined
File: "file:///data/data/org.nativescript.preview/files/app/tns_modules/tns-core-modules/ui/builder/builder.js, line: 75, column: 14

StackTrace:
Frame: function:'', file:'file:///data/data/org.nativescript.preview/files/app/tns_modules/tns-core-modules/ui/builder/builder.js', line: 75, column: 15
Frame: function:'FrameBase.navigate', file:'file:///data/data/org.nativescript.preview/files/app/tns_modules/tns-core-modules/ui/frame/frame-common.js', line: 119, column: 30
Frame: function:'ActivityCallbacksImplementation.setActivityContent', file:'file:///data/data/org.nativescript.preview/files/app/tns_modules/tns-core-modules/ui/frame/frame.js', line: 863, column: 30
Frame: function:'ActivityCallbacksImplementation.onCreate', file:'file:///data/data/org.nativescript.preview/files/app/tns_modules/tns-core-modules/ui/frame/frame.js', line: 722, column: 14
Frame: function:'NativeScriptActivity.onCreate', file:'file:///data/data/org.nativescript.preview/files/app/tns_modules/tns-core-modules/ui/frame/activity.js', line: 20, column: 25


at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2416)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2476)
at android.app.ActivityThread.-wrap11(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1344)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:5417)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
Caused by: com.tns.NativeScriptException:
Calling js method onCreate failed

TypeError: Cannot read property 'create' of undefined
File: "file:///data/data/org.nativescript.preview/files/app/tns_modules/tns-core-modules/ui/builder/builder.js, line: 75, column: 14

StackTrace:
Frame: function:'', file:'file:///data/data/org.nativescript.preview/files/app/tns_modules/tns-core-modules/ui/builder/builder.js', line: 75, column: 15
Frame: function:'FrameBase.navigate', file:'file:///data/data/org.nativescript.preview/files/app/tns_modules/tns-core-modules/ui/frame/frame-common.js', line: 119, column: 30
Frame: function:'ActivityCallbacksImplementation.setActivityContent', file:'file:///data/data/org.nativescript.preview/files/app/tns_modules/tns-core-modules/ui/frame/frame.js', line: 863, column: 30
Frame: function:'ActivityCallbacksImplementation.onCreate', file:'file:///data/data/org.nativescript.preview/files/app/tns_modules/tns-core-modules/ui/frame/frame.js', line: 722, column: 14
Frame: function:'NativeScriptActivity.onCreate', file:'file:///data/data/org.nativescript.preview/files/app/tns_modules/tns-core-modules/ui/frame/activity.js', line: 20, column: 25


at com.tns.Runtime.callJSMethodNative(Native Method)
at com.tns.Runtime.dispatchCallJSMethodNative(Runtime.java:1116)
at com.tns.Runtime.callJSMethodImpl(Runtime.java:996)
at com.tns.Runtime.callJSMethod(Runtime.java:983)
at com.tns.Runtime.callJSMethod(Runtime.java:967)
at com.tns.Runtime.callJSMethod(Runtime.java:959)
at com.tns.NativeScriptActivity.onCreate(NativeScriptActivity.java:18)
at android.app.Activity.performCreate(Activity.java:6251)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1107)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2369)
... 9 more









share|improve this question















I'm new to NativeScript and am checking it out to see if I can convert my Angular project to native. Unfortunately, I can't get it to preview anything. E.g., even a default Angular project created and converted to NS, like below throws errors on both my Android and iOS devices.



ng new Angular
cd Angular
ng add @nativescript/schematics
tns preview


The default project created with NativeScript directly (e.g., tns create NSAngular --ng) previews fine, so it is something to do with projects converted, looks like.



The errors vary and show up on both Linux (Fedora 29) and Windows (10), but they complain about missing app.component.html or not finding module "./" or something else. I can post the entire trace for one of those failures, if that helps, but I'm guessing (and hoping) this is a silly newbie error because even basic things are failing, and I would appreciate any help you could provide. Thanks!



Edit: Here are some logs.



LOG #1



com.tns.NativeScriptException: Application entry point file not found. Please specify the file in package.json otherwise make sure the file index.js or bootstrap.js exists.nIf using typescript make sure your entry point file is transpiled to javascript.
at com.tns.Module.bootstrapApp(Module.java:311)
at com.tns.Runtime.run(Runtime.java:544)
at com.tns.NativeScriptApplication.onCreate(NativeScriptApplication.java:21)
at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1013)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4707)
at android.app.ActivityThread.-wrap1(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1405)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:5417)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
Caused by: com.tns.NativeScriptException: Failed to find module: "./", relative to: app//
at com.tns.Module.resolvePathHelper(Module.java:146)
at com.tns.Module.bootstrapApp(Module.java:309)
... 12 more


LOG #2



2018-11-08 16:37:22.580 nsplaydev[5045:2029563] PlayLiveSync: applicationDidFinishLaunching

2018-11-08 16:37:22.592 nsplaydev[5045:2029563] ***** Fatal JavaScript exception - application has been terminated. *****

2018-11-08 16:37:22.592 nsplaydev[5045:2029563] Native stack trace:

1 0x105533f84 NativeScript::reportFatalErrorBeforeShutdown(JSC::ExecState*, JSC::Exception*, bool, bool)

2 0x105560fdc NativeScript::FFICallback<NativeScript::ObjCMethodCallback>::ffiClosureCallback(ffi_cif*, void*, void**, void*)

3 0x106039578 ffi_closure_SYSV_inner

4 0x10603c1b4 .Ldo_closure

5 0x233de0d14 <redacted>

6 0x233de0ce0 <redacted>

7 0x233de01d0 <redacted>

8 0x233ddfe7c <redacted>

9 0x233d581c0 <redacted>

10 0x233ddf908 _CFXNotificationPost

11 0x2347eeeb0 <redacted>

12 0x260c9d4fc <redacted>

13 0x260ca2e1c <redacted>

14 0x260543c18 <redacted>

15 0x26054c6f0 <redacted>

16 0x260543894 <redacted>

17 0x260544234 <redacted>

18 0x260542334 <redacted>

19 0x260541fe0 <redacted>

20 0x2605471a0 <redacted>

21 0x260548100 _performActionsWithDelayForTransitionContext

22 0x260547058 <redacted>

23 0x26054bd9c <redacted>

24 0x260ca1314 <redacted>

25 0x26088cc34 <redacted>

26 0x2368a3890 <redacted>

27 0x2368ae658 <redacted>

28 0x2368add50 <redacted>

29 0x2338ac484 <redacted>

30 0x2338833f0 <redacted>

31 0x2368e2640 <redacted>

2018-11-08 16:37:22.596 nsplaydev[5045:2029563] JavaScript stack trace:

2018-11-08 16:37:22.596 nsplaydev[5045:2029563] 1 resolve@file:///app/tns_modules/nativescript-angular/resource-loader.js:33:103

2 get@file:///app/tns_modules/nativescript-angular/resource-loader.js:19:40

3 _fetch@file:///app/tns_modules/@angular/compiler/bundles/compiler.umd.js:2465:50

4 _preParseTemplate@file:///app/tns_modules/@angular/compiler/bundles/compiler.umd.js:2504:39

5 normalizeTemplate@file:///app/tns_modules/@angular/compiler/bundles/compiler.umd.js:2492:57

6 loadDirectiveMetadata@file:///app/tns_modules/@angular/compiler/bundles/compiler.umd.js:10395:79

7 @file:///app/tns_modules/@angular/compiler/bundles/compiler.umd.js:23939:80

8 forEach@[native code]

9 @file:///app/tns_modules/@angular/compiler/bundles/compiler.umd.js:23938:83

10 forEach@[native code]

11 _loadModules@file:///app/tns_modules/@angular/compiler/bundles/compiler.umd.js:23935:86

12 _compileModuleAndComponents@file:///app/tns_modules/@angular/compiler/bundles/compiler.umd.js:23913:52

13 compileModuleAsync@file:///app/tns_modules/@angular/compiler/bundles/compiler.umd.js:23873:68

14 bootstrapModule@file:///app/tns_modules/@angular/core/bundles/core.umd.js:4414:47

15 _bootstrapper@file:///app/tns_modules/nativescript-angular/platform-common.js:85:50

16 @file:///app/tns_modules/nativescript-angular/platform-common.js:148:32

17 notify@file:///app/tns_modules/tns-core-modules/data/observable/observable.js:110:31

18 @[native code]

19 notifyAppStarted@file:///app/tns_modules/tns-core-modules/application/application.js:140:36

20 didFinishLaunchingWithOptions@file:///app/tns_modules/tns-core-modules/application/application.js:132:30

21 @[native code]

22 onReceive@file:///app/tns_modules/tns-core-modules/application/application.js:30:32

23 UIApplicationMain@[native code]

24 start@file:///app/tns_modules/tns-core-modules/application/application.js:273:26

25 run@file:///app/tns_modules/tns-core-modules/application/application.js:301:10

26 bootstrapNativeScriptApp@file:///app/tns_modules/nativescript-angular/platform-common.js:185:26

27 bootstrapApp@file:///app/tns_modules/nativescript-angular/platform-common.js:103:38

28 bootstrapModule@file:///app/tns_modules/nativescript-angular/platform-common.js:87:26

29 anonymous@file:///app/main.ns.js:10:57

30 evaluate@[native code]

31 moduleEvaluation@[native code]

32 promiseReactionJob@[native code]

2018-11-08 16:37:22.596 nsplaydev[5045:2029563] JavaScript error:

file:///app/tns_modules/nativescript-angular/resource-loader.js:33:103: JS ERROR Error: Could not resolve app.component.html. Looked for: /var/mobile/Containers/Data/Application/41C1E8E2-EC72-47F0-96A2-68C4A57AD22D/Documents/Playground/LiveSync/app/app.component.html.

2018-11-08 16:37:22.597 nsplaydev[5045:2029563] PlayLiveSync: Uncaught Exception

2018-11-08 16:37:22.598 nsplaydev[5045:2029563] *** JavaScript call stack:

(

0 UIApplicationMain@[native code]

1 start@file:///app/tns_modules/tns-core-modules/application/application.js:273:26

2 run@file:///app/tns_modules/tns-core-modules/application/application.js:301:10

3 bootstrapNativeScriptApp@file:///app/tns_modules/nativescript-angular/platform-common.js:185:26

4 bootstrapApp@file:///app/tns_modules/nativescript-angular/platform-common.js:103:38

5 bootstrapModule@file:///app/tns_modules/nativescript-angular/platform-common.js:87:26

6 anonymous@file:///app/main.ns.js:10:57

7 evaluate@[native code]

8 moduleEvaluation@:1:11

9 promiseReactionJob@:1:11

)

2018-11-08 16:37:22.598 nsplaydev[5045:2029563] *** Terminating app due to uncaught exception 'NativeScript encountered a fatal error: Error: Could not resolve app.component.html. Looked for: /var/mobile/Containers/Data/Application/41C1E8E2-EC72-47F0-96A2-68C4A57AD22D/Documents/Playground/LiveSync/app/app.component.html.

at

1 resolve@file:///app/tns_modules/nativescript-angular/resource-loader.js:33:103

2 get@file:///app/tns_modules/nativescript-angular/resource-loader.js:19:40

3 _fetch@file:///app/tns_modules/@angular/compiler/bundles/compiler.umd.js:2465:50

4 _preParseTemplate@file:///app/tns_modules/@angular/compiler/bundles/compiler.umd.js:2504:39

5 normalizeTemplate@file:///app/tns_modules/@angular/compiler/bundles/compiler.umd.js:2492:57

6 loadDirectiveMetadata@file:///app/tns_modules/@angular/compiler/bundles/compiler.umd.js:10395:79

7 @file:///app/tns_modules/@angular/compiler/bundles/compiler.umd.js:23939:80

8 forEach@[native code]

9 @file:///app/tns_modules/@angular/compiler/bundles/compiler.umd.js:23938:83

10 forEach@[native code]

11 _loadModules@file:///app/tns_modules/@angular/compiler/bundles/compiler.umd.js:23935:86

12 _compileModuleAndComponents@file:///app/tns_modules/@angular/compiler/bundles/compiler.umd.js:23913:52

13 compileModuleAsync@file:///app/tns_modules/@angular/compiler/bundles/compiler.umd.js:23873:68

14 bootstrapModule@file:///app/tns_modules/@angular/core/bundles/core.umd.js:4414:47

15 _bootstrapper@file:///app/tns_modules/nativescript-angular/platform-common.js:85:50

16 @file:///app/tns_modules/nativescript-angular/platform-common.js:148:32

17 notify@file:///app/tns_modules/tns-core-modules/data/observable/observable.js:110:31

18 @[native code]

19 notifyAppStarted@file:///app/tns_modules/tns-core-modules/application/application.js:140:36

20 didFinishLaunchingWithOptions@file:///app/tns_modules/tns-core-modules/application/application.js:132:30

21 @[native code]

22 onReceive@file:///app/tns_modules/tns-core-modules/application/application.js:30:32

23 UIApplicationMain@[native code]

24 start@file:///app/tns_modules/tns-core-modules/application/application.js:273:26

25 run@file:///app/tns_modules/tns-core-modules/application/application.js:301:10

26 bootstrapNativeScriptApp@file:///app/tns_modules/nativescript-angular/platform-common.js:185:26

27 bootstrapApp@file:///app/tns_modules/nativescript-angular/platform-common.js:103:38

28 bootstrapModule@file:///app/tns_modules/nativescript-angular/platform-common.js:87:26

29 anonymous@file:///app/main.ns.js:10:57

30 evaluate@[native code]

31 moduleEvaluation@[native code]

32 promiseReactionJob@[native code]

', reason: '(null)'

*** First throw call stack:

(0x233e73ef8 0x233041a40 0x1055342d4 0x105560fdc 0x106039578 0x10603c1b4 0x233de0d14 0x233de0ce0 0x233de01d0 0x233ddfe7c 0x233d581c0 0x233ddf908 0x2347eeeb0 0x260c9d4fc 0x260ca2e1c 0x260543c18 0x26054c6f0 0x260543894 0x260544234 0x260542334 0x260541fe0 0x2605471a0 0x260548100 0x260547058 0x26054bd9c 0x260ca1314 0x26088cc34 0x2368a3890 0x2368ae658 0x2368add50 0x2338ac484 0x2338833f0 0x2368e2640 0x2368e22cc 0x2368e28e8 0x233e025b8 0x233e02538 0x233e01e1c 0x233dfcce8 0x233dfc5b8 0x236070584 0x260ca4bc8 0x10603c044 0x106038c8c 0x106038750 0x105501740 0x10603780c 0x106036bd0 0x106036bd0 0x106036bd0 0x106036bd0 0x106036bd0 0x106036bd0 0x10602f870 0x105e258d8 0x105df1940 0x105fc4c6c 0x105514414 0x105654f7c 0x1060376e8 0x106036bd0 0x106036bd0 0x10602f870 0x105e258d8 0x105df1940 0x105fc4dbc 0x10564c38c 0x10550ba80 0x10556c5a0 0x1052f0154 0x104d5b4f4 0x2338bcb94)

libc++abi.dylib: terminating with uncaught exception of type NSException

2018-11-08 16:37:22.598 nsplaydev[5045:2029563] PlayLiveSync: Uncaught Exception


LOG #3



An uncaught Exception occurred on "main" thread.
java.lang.RuntimeException: Unable to start activity ComponentInfo{org.nativescript.preview/com.tns.NativeScriptActivity}: com.tns.NativeScriptException:
Calling js method onCreate failed

TypeError: Cannot read property 'create' of undefined
File: "file:///data/data/org.nativescript.preview/files/app/tns_modules/tns-core-modules/ui/builder/builder.js, line: 75, column: 14

StackTrace:
Frame: function:'', file:'file:///data/data/org.nativescript.preview/files/app/tns_modules/tns-core-modules/ui/builder/builder.js', line: 75, column: 15
Frame: function:'FrameBase.navigate', file:'file:///data/data/org.nativescript.preview/files/app/tns_modules/tns-core-modules/ui/frame/frame-common.js', line: 119, column: 30
Frame: function:'ActivityCallbacksImplementation.setActivityContent', file:'file:///data/data/org.nativescript.preview/files/app/tns_modules/tns-core-modules/ui/frame/frame.js', line: 863, column: 30
Frame: function:'ActivityCallbacksImplementation.onCreate', file:'file:///data/data/org.nativescript.preview/files/app/tns_modules/tns-core-modules/ui/frame/frame.js', line: 722, column: 14
Frame: function:'NativeScriptActivity.onCreate', file:'file:///data/data/org.nativescript.preview/files/app/tns_modules/tns-core-modules/ui/frame/activity.js', line: 20, column: 25


at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2416)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2476)
at android.app.ActivityThread.-wrap11(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1344)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:5417)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
Caused by: com.tns.NativeScriptException:
Calling js method onCreate failed

TypeError: Cannot read property 'create' of undefined
File: "file:///data/data/org.nativescript.preview/files/app/tns_modules/tns-core-modules/ui/builder/builder.js, line: 75, column: 14

StackTrace:
Frame: function:'', file:'file:///data/data/org.nativescript.preview/files/app/tns_modules/tns-core-modules/ui/builder/builder.js', line: 75, column: 15
Frame: function:'FrameBase.navigate', file:'file:///data/data/org.nativescript.preview/files/app/tns_modules/tns-core-modules/ui/frame/frame-common.js', line: 119, column: 30
Frame: function:'ActivityCallbacksImplementation.setActivityContent', file:'file:///data/data/org.nativescript.preview/files/app/tns_modules/tns-core-modules/ui/frame/frame.js', line: 863, column: 30
Frame: function:'ActivityCallbacksImplementation.onCreate', file:'file:///data/data/org.nativescript.preview/files/app/tns_modules/tns-core-modules/ui/frame/frame.js', line: 722, column: 14
Frame: function:'NativeScriptActivity.onCreate', file:'file:///data/data/org.nativescript.preview/files/app/tns_modules/tns-core-modules/ui/frame/activity.js', line: 20, column: 25


at com.tns.Runtime.callJSMethodNative(Native Method)
at com.tns.Runtime.dispatchCallJSMethodNative(Runtime.java:1116)
at com.tns.Runtime.callJSMethodImpl(Runtime.java:996)
at com.tns.Runtime.callJSMethod(Runtime.java:983)
at com.tns.Runtime.callJSMethod(Runtime.java:967)
at com.tns.Runtime.callJSMethod(Runtime.java:959)
at com.tns.NativeScriptActivity.onCreate(NativeScriptActivity.java:18)
at android.app.Activity.performCreate(Activity.java:6251)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1107)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2369)
... 9 more






angular nativescript






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 9 at 16:55

























asked Nov 9 at 15:39









Sekhar Ravinutala

216




216












  • Yes, please. Post the entire failure log, that might give us some clue.
    – Manoj
    Nov 9 at 16:18










  • Please see, if these instructions help you. docs.nativescript.org/code-sharing/creating-a-new-project
    – Baskar
    Nov 9 at 16:28










  • Thanks Manoj, I've added some traces. Baskar, my goal is to convert an existing Angular project to NS; creating a new one (at least with tns) works fine, but is not useful for me.
    – Sekhar Ravinutala
    Nov 9 at 16:57


















  • Yes, please. Post the entire failure log, that might give us some clue.
    – Manoj
    Nov 9 at 16:18










  • Please see, if these instructions help you. docs.nativescript.org/code-sharing/creating-a-new-project
    – Baskar
    Nov 9 at 16:28










  • Thanks Manoj, I've added some traces. Baskar, my goal is to convert an existing Angular project to NS; creating a new one (at least with tns) works fine, but is not useful for me.
    – Sekhar Ravinutala
    Nov 9 at 16:57
















Yes, please. Post the entire failure log, that might give us some clue.
– Manoj
Nov 9 at 16:18




Yes, please. Post the entire failure log, that might give us some clue.
– Manoj
Nov 9 at 16:18












Please see, if these instructions help you. docs.nativescript.org/code-sharing/creating-a-new-project
– Baskar
Nov 9 at 16:28




Please see, if these instructions help you. docs.nativescript.org/code-sharing/creating-a-new-project
– Baskar
Nov 9 at 16:28












Thanks Manoj, I've added some traces. Baskar, my goal is to convert an existing Angular project to NS; creating a new one (at least with tns) works fine, but is not useful for me.
– Sekhar Ravinutala
Nov 9 at 16:57




Thanks Manoj, I've added some traces. Baskar, my goal is to convert an existing Angular project to NS; creating a new one (at least with tns) works fine, but is not useful for me.
– Sekhar Ravinutala
Nov 9 at 16:57












2 Answers
2






active

oldest

votes

















up vote
0
down vote













I'd recommend you to create new, blank tns project somewhere aside and then compare your structure.



19 notifyAppStarted@file:///app/tns_modules/tns-core-modules/application/application.js:140:36



can mean that file pointed in your package.json is not correct. Either it does not exists, or it is not in .ts format.



Could you provide your package.json content, where your main is defined and directory structure? We'd be able to investigate further.






share|improve this answer





















  • Thanks, comparing was actually the first thing I did, replacing one/one in the failing one to see when it started working again. Unfortunately the errors I get keep changing, so it was difficult to pinpoint the issue without spending a ton of time. What's strange is that even the default Angular app doesn't work. I will try again later when I find time and report back if I find a fix.
    – Sekhar Ravinutala
    Nov 14 at 15:30










  • have you solved it yet? I've just moved my project's structure from custom-undefined to the one from ng-template-blank and successfully adjusted all files. I'm a little bit more up-to-date with such migration, we can work on it together.
    – ogrodowiczp
    Nov 15 at 12:39










  • Thanks a bunch for the offer. No, I didn't get a chance to work on it again, but will soon. If you're able to create a default Angular project and convert it to NS (like I explained in my original post), could you please outline how you did it? Perhaps I'm missing something basic, but all I can say is that the method described in the NS docs is NOT working for me.
    – Sekhar Ravinutala
    Nov 23 at 19:14


















up vote
0
down vote



accepted










Turns out all I had to do was add a --bundle flag to the preview call, as in:



tns preview --bundle


Thanks to the NS team who responded quickly to my issue on GitHub - you will find other details there if you're interested, along with working code.






share|improve this answer





















    Your Answer






    StackExchange.ifUsing("editor", function () {
    StackExchange.using("externalEditor", function () {
    StackExchange.using("snippets", function () {
    StackExchange.snippets.init();
    });
    });
    }, "code-snippets");

    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "1"
    };
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function() {
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled) {
    StackExchange.using("snippets", function() {
    createEditor();
    });
    }
    else {
    createEditor();
    }
    });

    function createEditor() {
    StackExchange.prepareEditor({
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader: {
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    },
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    });


    }
    });














    draft saved

    draft discarded


















    StackExchange.ready(
    function () {
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53228847%2fnativescript-preview-problems%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    2 Answers
    2






    active

    oldest

    votes








    2 Answers
    2






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes








    up vote
    0
    down vote













    I'd recommend you to create new, blank tns project somewhere aside and then compare your structure.



    19 notifyAppStarted@file:///app/tns_modules/tns-core-modules/application/application.js:140:36



    can mean that file pointed in your package.json is not correct. Either it does not exists, or it is not in .ts format.



    Could you provide your package.json content, where your main is defined and directory structure? We'd be able to investigate further.






    share|improve this answer





















    • Thanks, comparing was actually the first thing I did, replacing one/one in the failing one to see when it started working again. Unfortunately the errors I get keep changing, so it was difficult to pinpoint the issue without spending a ton of time. What's strange is that even the default Angular app doesn't work. I will try again later when I find time and report back if I find a fix.
      – Sekhar Ravinutala
      Nov 14 at 15:30










    • have you solved it yet? I've just moved my project's structure from custom-undefined to the one from ng-template-blank and successfully adjusted all files. I'm a little bit more up-to-date with such migration, we can work on it together.
      – ogrodowiczp
      Nov 15 at 12:39










    • Thanks a bunch for the offer. No, I didn't get a chance to work on it again, but will soon. If you're able to create a default Angular project and convert it to NS (like I explained in my original post), could you please outline how you did it? Perhaps I'm missing something basic, but all I can say is that the method described in the NS docs is NOT working for me.
      – Sekhar Ravinutala
      Nov 23 at 19:14















    up vote
    0
    down vote













    I'd recommend you to create new, blank tns project somewhere aside and then compare your structure.



    19 notifyAppStarted@file:///app/tns_modules/tns-core-modules/application/application.js:140:36



    can mean that file pointed in your package.json is not correct. Either it does not exists, or it is not in .ts format.



    Could you provide your package.json content, where your main is defined and directory structure? We'd be able to investigate further.






    share|improve this answer





















    • Thanks, comparing was actually the first thing I did, replacing one/one in the failing one to see when it started working again. Unfortunately the errors I get keep changing, so it was difficult to pinpoint the issue without spending a ton of time. What's strange is that even the default Angular app doesn't work. I will try again later when I find time and report back if I find a fix.
      – Sekhar Ravinutala
      Nov 14 at 15:30










    • have you solved it yet? I've just moved my project's structure from custom-undefined to the one from ng-template-blank and successfully adjusted all files. I'm a little bit more up-to-date with such migration, we can work on it together.
      – ogrodowiczp
      Nov 15 at 12:39










    • Thanks a bunch for the offer. No, I didn't get a chance to work on it again, but will soon. If you're able to create a default Angular project and convert it to NS (like I explained in my original post), could you please outline how you did it? Perhaps I'm missing something basic, but all I can say is that the method described in the NS docs is NOT working for me.
      – Sekhar Ravinutala
      Nov 23 at 19:14













    up vote
    0
    down vote










    up vote
    0
    down vote









    I'd recommend you to create new, blank tns project somewhere aside and then compare your structure.



    19 notifyAppStarted@file:///app/tns_modules/tns-core-modules/application/application.js:140:36



    can mean that file pointed in your package.json is not correct. Either it does not exists, or it is not in .ts format.



    Could you provide your package.json content, where your main is defined and directory structure? We'd be able to investigate further.






    share|improve this answer












    I'd recommend you to create new, blank tns project somewhere aside and then compare your structure.



    19 notifyAppStarted@file:///app/tns_modules/tns-core-modules/application/application.js:140:36



    can mean that file pointed in your package.json is not correct. Either it does not exists, or it is not in .ts format.



    Could you provide your package.json content, where your main is defined and directory structure? We'd be able to investigate further.







    share|improve this answer












    share|improve this answer



    share|improve this answer










    answered Nov 10 at 9:11









    ogrodowiczp

    216




    216












    • Thanks, comparing was actually the first thing I did, replacing one/one in the failing one to see when it started working again. Unfortunately the errors I get keep changing, so it was difficult to pinpoint the issue without spending a ton of time. What's strange is that even the default Angular app doesn't work. I will try again later when I find time and report back if I find a fix.
      – Sekhar Ravinutala
      Nov 14 at 15:30










    • have you solved it yet? I've just moved my project's structure from custom-undefined to the one from ng-template-blank and successfully adjusted all files. I'm a little bit more up-to-date with such migration, we can work on it together.
      – ogrodowiczp
      Nov 15 at 12:39










    • Thanks a bunch for the offer. No, I didn't get a chance to work on it again, but will soon. If you're able to create a default Angular project and convert it to NS (like I explained in my original post), could you please outline how you did it? Perhaps I'm missing something basic, but all I can say is that the method described in the NS docs is NOT working for me.
      – Sekhar Ravinutala
      Nov 23 at 19:14


















    • Thanks, comparing was actually the first thing I did, replacing one/one in the failing one to see when it started working again. Unfortunately the errors I get keep changing, so it was difficult to pinpoint the issue without spending a ton of time. What's strange is that even the default Angular app doesn't work. I will try again later when I find time and report back if I find a fix.
      – Sekhar Ravinutala
      Nov 14 at 15:30










    • have you solved it yet? I've just moved my project's structure from custom-undefined to the one from ng-template-blank and successfully adjusted all files. I'm a little bit more up-to-date with such migration, we can work on it together.
      – ogrodowiczp
      Nov 15 at 12:39










    • Thanks a bunch for the offer. No, I didn't get a chance to work on it again, but will soon. If you're able to create a default Angular project and convert it to NS (like I explained in my original post), could you please outline how you did it? Perhaps I'm missing something basic, but all I can say is that the method described in the NS docs is NOT working for me.
      – Sekhar Ravinutala
      Nov 23 at 19:14
















    Thanks, comparing was actually the first thing I did, replacing one/one in the failing one to see when it started working again. Unfortunately the errors I get keep changing, so it was difficult to pinpoint the issue without spending a ton of time. What's strange is that even the default Angular app doesn't work. I will try again later when I find time and report back if I find a fix.
    – Sekhar Ravinutala
    Nov 14 at 15:30




    Thanks, comparing was actually the first thing I did, replacing one/one in the failing one to see when it started working again. Unfortunately the errors I get keep changing, so it was difficult to pinpoint the issue without spending a ton of time. What's strange is that even the default Angular app doesn't work. I will try again later when I find time and report back if I find a fix.
    – Sekhar Ravinutala
    Nov 14 at 15:30












    have you solved it yet? I've just moved my project's structure from custom-undefined to the one from ng-template-blank and successfully adjusted all files. I'm a little bit more up-to-date with such migration, we can work on it together.
    – ogrodowiczp
    Nov 15 at 12:39




    have you solved it yet? I've just moved my project's structure from custom-undefined to the one from ng-template-blank and successfully adjusted all files. I'm a little bit more up-to-date with such migration, we can work on it together.
    – ogrodowiczp
    Nov 15 at 12:39












    Thanks a bunch for the offer. No, I didn't get a chance to work on it again, but will soon. If you're able to create a default Angular project and convert it to NS (like I explained in my original post), could you please outline how you did it? Perhaps I'm missing something basic, but all I can say is that the method described in the NS docs is NOT working for me.
    – Sekhar Ravinutala
    Nov 23 at 19:14




    Thanks a bunch for the offer. No, I didn't get a chance to work on it again, but will soon. If you're able to create a default Angular project and convert it to NS (like I explained in my original post), could you please outline how you did it? Perhaps I'm missing something basic, but all I can say is that the method described in the NS docs is NOT working for me.
    – Sekhar Ravinutala
    Nov 23 at 19:14












    up vote
    0
    down vote



    accepted










    Turns out all I had to do was add a --bundle flag to the preview call, as in:



    tns preview --bundle


    Thanks to the NS team who responded quickly to my issue on GitHub - you will find other details there if you're interested, along with working code.






    share|improve this answer

























      up vote
      0
      down vote



      accepted










      Turns out all I had to do was add a --bundle flag to the preview call, as in:



      tns preview --bundle


      Thanks to the NS team who responded quickly to my issue on GitHub - you will find other details there if you're interested, along with working code.






      share|improve this answer























        up vote
        0
        down vote



        accepted







        up vote
        0
        down vote



        accepted






        Turns out all I had to do was add a --bundle flag to the preview call, as in:



        tns preview --bundle


        Thanks to the NS team who responded quickly to my issue on GitHub - you will find other details there if you're interested, along with working code.






        share|improve this answer












        Turns out all I had to do was add a --bundle flag to the preview call, as in:



        tns preview --bundle


        Thanks to the NS team who responded quickly to my issue on GitHub - you will find other details there if you're interested, along with working code.







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Dec 4 at 17:09









        Sekhar Ravinutala

        216




        216






























            draft saved

            draft discarded




















































            Thanks for contributing an answer to Stack Overflow!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            To learn more, see our tips on writing great answers.





            Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


            Please pay close attention to the following guidance:


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53228847%2fnativescript-preview-problems%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            這個網誌中的熱門文章

            Tangent Lines Diagram Along Smooth Curve

            Yusuf al-Mu'taman ibn Hud

            Zucchini