_From @YouYII on December 6, 2016 16:49_
Android app can not run properly.
tns_modules only a small amount of the module.
$ ls platforms/android/src/main/assets/app/tns_modules/
common core http platform-browser-dynamic
compiler forms platform-browser router
Android
After install firebase , can not run project on android ,then uninstall this plugin.
May be related to the issue : https://github.com/NativeScript/nativescript-cli/issues/637
_Copied from original issue: NativeScript/NativeScript#3252_
_From @YouYII on December 6, 2016 16:50_
I encountered this problem again
$ ls platforms/android/src/main/assets/app/tns_modules/
common core http platform-browser-dynamic
compiler forms platform-browser router
Run android project
An uncaught Exception occurred on "main" thread.
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: "nativescript-angular/platform", relative to: app/tns_modules/
com.tns.Module.resolvePathHelper(Module.java:159)
com.tns.Module.resolvePath(Module.java:60)
com.tns.Runtime.runModule(Native Method)
com.tns.Runtime.runModule(Runtime.java:514)
com.tns.Runtime.run(Runtime.java:509)
com.tns.NativeScriptApplication.onCreate(NativeScriptApplication.java:17)
android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1011)
android.app.ActivityThread.handleBindApplication(ActivityThread.java:4518)
android.app.ActivityThread.access$1500(ActivityThread.java:144)
android.app.ActivityThread$H.handleMessage(ActivityThread.java:1339)
android.os.Handler.dispatchMessage(Handler.java:102)
I tried the following command
$ rm -rf node_modules && rm -rf platform
$ tns prepare android
Copying template files...
Project successfully created.
Executing before-prepare hook from /Users/zy/Workspaces/EasyReader/hooks/before-prepare/nativescript-dev-android-snapshot.js
Executing before-prepare hook from /Users/zy/Workspaces/EasyReader/hooks/before-prepare/nativescript-dev-sass.js
Executing before-prepare hook from /Users/zy/Workspaces/EasyReader/hooks/before-prepare/nativescript-dev-typescript.js
Found peer TypeScript 2.1.1
Bus error: 10
$ tns run android
But wrong again.This problem has been bothering me for two days...
Hey, @YouYII are you still reproducing this issue with NativeScript 2.5.2?
I haven't engaged in NS development recently , Sorry
@NickIliev, I guess I don't know if this is exactly the same situation, but I can recreate a "Bus Error: 10" reliably with 2.5.2. It happens for me after installing the NPM module moment-range
It can happen right away in a fresh project.
tns create BusErrorTest
cd BusErrorTest
npm install --save moment-range
tns prepare android
/* Outputs
[... first time sets up tns-android packages ...]
Executing before-prepare hook from /[SomePath]/BusErrorTest/hooks/before-prepare/nativescript-dev-android-snapshot.js
Preparing project...
Bus error: 10
*/
Uninstalling moment-range stops the error, so I guess it's something to do with the configuration of certain modules.
For reference, Node v6.10.0 (LTS) on OS X 10.12.1
Just a note for people who encounter this error in the future: the solution tdous described (uninstalling a node module) resolved this issue for me, too. I started seeing this error after installing babel-register for running some setup scripts and found that removing the babel-register module resolved the issue.
nativescript-cli 2.5.3, Node 6.3.1, OS X 10.12.3
@BinaryNate @tdous Thanks for the info.
Can you please check if issue still exists in {N} 3.0.0.
I can not reproduce with steps from @tdous
Closing due to inactivity.
Most helpful comment
@NickIliev, I guess I don't know if this is exactly the same situation, but I can recreate a "Bus Error: 10" reliably with 2.5.2. It happens for me after installing the NPM module moment-range
It can happen right away in a fresh project.
Uninstalling moment-range stops the error, so I guess it's something to do with the configuration of certain modules.
For reference, Node v6.10.0 (LTS) on OS X 10.12.1