Skip to content

App crashes when re-visited after a couple of hours on Android, failed to find module. / relative to / #1422

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

Closed
basumeet opened this issue Jan 22, 2016 · 4 comments

Comments

@basumeet
Copy link

java.lang.RuntimeException: Unable to create application com.tns.NativeScriptApplication: com.tns.NativeScriptException: Failed to find module: "./", relative to: /
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4443)
at android.app.ActivityThread.access$1500(ActivityThread.java:141)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1272)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:136)
at android.app.ActivityThread.main(ActivityThread.java:5113)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:609)
at dalvik.system.NativeStart.main(Native Method)
Caused by: com.tns.NativeScriptException: Failed to find module: "./", relative to: /
at com.tns.Module.resolvePathHelper(Module.java:197)
at com.tns.Module.bootstrapApp(Module.java:229)
at com.tns.Platform.run(Platform.java:175)
at com.tns.NativeScriptApplication.onCreate(NativeScriptApplication.java:784)
at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1007)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4440)
... 10 more

@slavchev
Copy link

Hi @basumeet

I recently fixed similar issue (see NativeScript/android#334). Can you provide more details? Any steps to reproduce the issue will help us. Also, I am interested in the packages.json files you use. If there is an option to send us a repro project it will be appreciated.

@basumeet
Copy link
Author

Hi @slavchev , unfortunately, I can't send the repo right now, I will have to ask my client's permission in order to do so, but I can share the package.json and other details till then.
The package.json file:
{ "name": "tns-template-hello-world", "main": "app.js", "jsoptions": "--expose_gc", "version": "1.3.0", "author": "Telerik <[email protected]>", "description": "Nativescript hello-world project template", "license": "BSD", "keywords": [ "telerik", "mobile", "nativescript", "{N}", "tns", "appbuilder", "template" ], "repository": { "type": "git", "url": "git://github.com/NativeScript/template-hello-world.git" }, "bugs": { "url": "https://github.com/NativeScript/template-hello-world/issues" }, "homepage": "https://github.com/NativeScript/template-hello-world" }

Regarding the app, it needs constant connectivity to internet in order to work, and I am using https://docs.nativescript.org/ApiReference/connectivity/HOW-TO.html to check for connectivity .
I am instantiating android videoView(http://developer.android.com/reference/android/widget/VideoView.html),
android MessageHandler(http://developer.android.com/reference/android/os/Handler.html),
and android spinner (http://developer.android.com/guide/topics/ui/controls/spinner.html) in the app.

When the app is in background for a couple of hours , and is relaunched from the android task menu , it throws the error, irrespective of internet connectivity.

I am using android kitkat 4.4.4 device.

I am using nativescript runtime 1.5.0 to build this.

@rosen-vladimirov
Copy link
Contributor

Ok, I believe this is the same issue as this one - #1332 so I'm closing this thread

@rosen-vladimirov
Copy link
Contributor

Just to clarify - some files remain in fullsync directory on the device as runtime is unable to remove them. After that when the app is relaunched, the runtime uses only the files in fullsync dir and it fails to find entry point as this is not a full app :)

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

3 participants