I create Angular 2 nativescript project with tns create name --ng
command and after adding android platform with tns platform add android
command, i run the project with tns run android
command in a connected nexus 6p with android version 7.1.1 and when app deployed to the device i got this error:
An uncaught Exception occurred on "main" thread.
java.lang.RuntimeException: Unable to create application com.tns.NativeScriptApplication: 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 android.app.ActivityThread.handleBindApplication(ActivityThread.java:5406)
at android.app.ActivityThread.-wrap2(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1545)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6119)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:886)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:776)
Caused by: 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:337)
at com.tns.Runtime.run(Runtime.java:508)
at com.tns.NativeScriptApplication.onCreate(NativeScriptApplication.java:17)
at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1024)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:5403)
... 8 more
Caused by: com.tns.NativeScriptException: Failed to find module: "./", relative to: app//
at com.tns.Module.resolvePathHelper(Module.java:159)
at com.tns.Module.bootstrapApp(Module.java:335)
... 12 more
the main problem is that none of .ts
files transpiled into .js
file.
More details:
Android Platform
CLI: 2.4.2
Hi @Pourya8366,
Thank you for your interest in NativeScript.
I tested the given case, however was unable to reproduce this behavior. Could you try to follow the below given steps.
node_modules
, platforms
, hooks
foldersnpm cache clear
tns run android
Regarding to the project could you give us some more info for the node
version and whether you are using latest LTS version 6.9.2.
Hope this helps.
Thanks you very much, i updated the node and the problem solved!
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Most helpful comment
Hi @Pourya8366,
Thank you for your interest in NativeScript.
I tested the given case, however was unable to reproduce this behavior. Could you try to follow the below given steps.
node_modules
,platforms
,hooks
foldersnpm cache clear
tns run android
Regarding to the project could you give us some more info for the
node
version and whether you are using latest LTS version 6.9.2.Hope this helps.