Skip to content

tns run android not working #5507

@Volterra90

Description

@Volterra90

Hi!

I'm trying to build a new app with nativescript, but I can't do it properly.

I have installed nativescript versión 7.21 and the new node LTS version 14.16.0 in my machine.

First, I run tns create and choose the Hello World template, and the project builds correctly.

Next I run tns run android --bundle, and the app is installed in the emulator I'm opening with Android Studio, but when I open the app, the app crashes with the next error:

An uncaught Exception occurred on "main" thread.
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.

StackTrace:
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:6717)
	at android.app.ActivityThread.access$1300(ActivityThread.java:237)
	at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1913)
	at android.os.Handler.dispatchMessage(Handler.java:106)
	at android.os.Looper.loop(Looper.java:223)
	at android.app.ActivityThread.main(ActivityThread.java:7656)
	at java.lang.reflect.Method.invoke(Native Method)
	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:592)
	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:947)
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:316)
	at com.tns.Runtime.run(Runtime.java:680)
	at com.tns.NativeScriptApplication.onCreate(NativeScriptApplication.java:21)
	at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1192)
	at android.app.ActivityThread.handleBindApplication(ActivityThread.java:6712)
	... 8 more
Caused by: com.tns.NativeScriptException: Failed to find module: "./", relative to: app//
	at com.tns.Module.resolvePathHelper(Module.java:151)
	at com.tns.Module.bootstrapApp(Module.java:314)
	... 12 more

I tried building the app again, with the same result. I also tried to clean npm cache and rebuild the app, with the same result.

Let me know if you need more data to check the issue.

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions