0

sencha app build -run native packages the files for native devices and can be tested in simulator. However I often see error in adb logcat complaining about undefined type in app.js. Exact error:

D/CordovaLog(  890): file:///android_asset/www/app.js: Line 1 : Uncaught TypeError: Cannot read property 'type' of undefined
I/chromium(  890): [INFO:CONSOLE(1)] "Uncaught TypeError: Cannot read property 'type' of undefined", source: file:///android_asset/www/app.js (1)

Runtime complains about a Java script error but because the entire file is concatenated (minified) into 1 line, its difficult to identify the exact error.

How can we get expanded version of app.js when we build for simulators in sencha touch.

Using sencha app build testing, I can use chrome emulator and validate. However few times, chrome emulator works fine but the actual device simulators fail and make it difficult to debug. Is there an option to get expanded version of app.js packaged for native testing?

suman j
  • 6,710
  • 11
  • 58
  • 109

1 Answers1

0

You can use phonegap/cordova to pack your app manually using the testing build of your sencha app.

Martin
  • 852
  • 7
  • 20
  • If I use the testing build of app.js, I do not see the failure. It fails only when I work with native build. Also root cause is cordova.js entry in app.json file. This file is added as a remote dependency. If I take this out and run `sencha app build -run native`, I see simulator works fine. – suman j Jul 24 '14 at 21:04
  • As I said, when you want the not minified version of your app running on a native device use cordova/phonegap to pack your app manually and include the testing build of sencha. Actually you don't even have to create the testing build. You can also just copy your sencha directory directly into the cordova/phonegap build. So you won't get the "error in line 1 of app.js" error anymore but the correct location of the error. – Martin Jul 25 '14 at 05:41