Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NativeScriptException: Failed to fin module: "timers" relative to: "/app/tns_modules/" #135

Closed
georgeonofrei opened this issue Sep 12, 2016 · 3 comments

Comments

@georgeonofrei
Copy link

This is the entire stacktrace:

java.lang.RuntimeException: Unable to create application com.tns.NativeScriptApplication: com.tns.NativeScriptException:
Error calling module function

Error: com.tns.NativeScriptException: Failed to find module: "timers", relative to: /app/tns_modules/
com.tns.Module.resolvePathHelper(Module.java:220)
com.tns.Module.resolvePath(Module.java:60)
com.tns.Runtime.runModule(Native Method)
com.tns.Runtime.runModule(Runtime.java:241)
com.tns.Runtime.run(Runtime.java:235)
com.tns.NativeScriptApplication.onCreate(NativeScriptApplication.java:17)
android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1024)
android.app.ActivityThread.handleBindApplication(ActivityThread.java:5361)
android.app.ActivityThread.-wrap2(ActivityThread.java)
android.app.ActivityThread$H.handleMessage(ActivityThread.java:1528)
android.os.Handler.dispatchMessage(Handler.java:102)
android.os.Looper.loop(Looper.java:154)
android.app.ActivityThread.main(ActivityThread.java:6077)
java.lang.reflect.Method.invoke(Native Method)
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:865)
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:755)
File: ", line: 1, column: 265

StackTrace:
Frame: function:'require', file:'', line: 1, column: 266
Frame: function:'', file:'/data/data/org.nativescript.groceries/files/app/tns_modules/zone.js/dist/zone-node.js', line: 670, column: 14
Frame: function:'require', file:'', line: 1, column: 266
Frame: function:'', file:'/data/data/org.nativescript.groceries/files/app/tns_modules/nativescript-angular/application.js', line: 2, column: 1
Frame: function:'require', file:'', line: 1, column: 266
Frame: function:'', file:'/data/data/org.nativescript.groceries/files/app/main.js', line: 2, column: 21
Frame: function:'require', file:'', line: 1, column: 266

at android.app.ActivityThread.handleBindApplication(ActivityThread.java:5364)
at android.app.ActivityThread.-wrap2(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1528)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6077)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:865)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:755)

Caused by: com.tns.NativeScriptException:
Error calling module function

Error: com.tns.NativeScriptException: Failed to find module: "timers", relative to: /app/tns_modules/
com.tns.Module.resolvePathHelper(Module.java:220)
com.tns.Module.resolvePath(Module.java:60)
com.tns.Runtime.runModule(Native Method)
com.tns.Runtime.runModule(Runtime.java:241)
com.tns.Runtime.run(Runtime.java:235)
com.tns.NativeScriptApplication.onCreate(NativeScriptApplication.java:17)
android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1024)
android.app.ActivityThread.handleBindApplication(ActivityThread.java:5361)
android.app.ActivityThread.-wrap2(ActivityThread.java)
android.app.ActivityThread$H.handleMessage(ActivityThread.java:1528)
android.os.Handler.dispatchMessage(Handler.java:102)
android.os.Looper.loop(Looper.java:154)
android.app.ActivityThread.main(ActivityThread.java:6077)
java.lang.reflect.Method.invoke(Native Method)
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:865)
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:755)
File: ", line: 1, column: 265

StackTrace:
Frame: function:'require', file:'', line: 1, column: 266
Frame: function:'', file:'/data/data/org.nativescript.groceries/files/app/tns_modules/zone.js/dist/zone-node.js', line: 670, column: 14
Frame: function:'require', file:'', line: 1, column: 266
Frame: function:'', file:'/data/data/org.nativescript.groceries/files/app/tns_modules/nativescript-angular/application.js', line: 2, column: 1
Frame: function:'require', file:'', line: 1, column: 266
Frame: function:'', file:'/data/data/org.nativescript.groceries/files/app/main.js', line: 2, column: 21
Frame: function:'require', file:'', line: 1, column: 266

at com.tns.Runtime.runModule(Native Method)
at com.tns.Runtime.runModule(Runtime.java:241)
at com.tns.Runtime.run(Runtime.java:235)
at com.tns.NativeScriptApplication.onCreate(NativeScriptApplication.java:17)
at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1024)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:5361)
... 8 more

What I did is clone the repo, checkout angular-end, platform add android, build android.
Any ideas where this may be coming from? I am using the latest Android SDK.

Thanks,
George

@tjvantoll
Copy link
Contributor

Hey @georgeonofrei,

Thanks for letting us know. This seems to be related to NativeScript/nativescript-angular#444. I might need to set an explicit zone.js version in the package.json on this branch. Let me do some tinkering.

tjvantoll added a commit that referenced this issue Sep 12, 2016
@tjvantoll
Copy link
Contributor

Closed with 9181eb1. It was indeed the zone.js problem. Thanks again @georgeonofrei!

@georgeonofrei
Copy link
Author

I confirm that the applied fix works. So now the app starts, although a bit slower than I expected.
But it works!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants