Android bundling with Webpack


#1

Having the issue at the moment when extending an application class with a custom name com.someCompany.SomeApp is having issues when going through the bundle process. For extending the application class I mean this: https://docs.nativescript.org/runtimes/android/advanced-topics/extend-application-activity

This is using the JavaProxy decorator and also using the correct reference name to the AndroidManifest.xml file.

It works well without bundling but with bundling the problem occurs when the app is trying to start and on some android devices it freezes and on others it crashes.

The command I am running is using the --bundle flag which runs uglify and also some other magic the cli does to prep the project for release. full command looks like the following

tns run android --bundle

Error output

02-02 19:42:27.200  3351  3351 W System.err:     com.tns.Runtime.createJSInstance(Runtime.java:603)
02-02 19:42:27.201  3351  3351 W System.err:     com.tns.Runtime.createJSInstance(Runtime.java:603)
02-02 19:42:27.202  3351  3351 W System.err:     com.tns.Runtime.createJSInstance(Runtime.java:603)
02-02 19:42:27.203  3351  3351 W System.err: 	at com.tns.Runtime.createJSInstance(Runtime.java:603)

Anyone has had this issue before?


#2

Please define bundling in your question. I’ll make an assumption and say that you use Webpack, in that case the most likely case for errors would be that the code is uglified (I am guessing here :D).


#3

Haha good one :wink: I’ll update my question


#4

Quite possible that you got error from some missing things if you directly call tns run android --bundle but need to be called with one of npm run scripts commands http://docs.nativescript.org/angular/tooling/bundling-with-webpack.html#bundling you can them here