[TIMOB-12762] Backport: CLI: using --skip-js-minify on android dist-playstore builds results in "missing app.js" error on device
GitHub Issue | n/a |
---|---|
Type | Sub-task |
Priority | Critical |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2013-02-15T23:39:13.000+0000 |
Affected Version/s | Release 3.0.2 |
Fix Version/s | Release 3.0.2, Release 3.1.0, 2013 Sprint 04 JS, 2013 Sprint 04 |
Components | Android |
Labels | qe-sdk3.0.2 |
Reporter | Eric Merriman |
Assignee | Chris Barber |
Created | 2013-02-15T22:32:07.000+0000 |
Updated | 2013-02-19T18:13:37.000+0000 |
Description
When packaging, I found that android projects with an error in the code were packaging without problem, but failed on device in an unexpected way. The failure in logcat was:
D/dalvikvm( 6716): No JNI_OnLoad found in libcom.crittercism.ti.so 0x41aa3cc0, skipping init
E/TiAssetHelper( 6716): Error while reading asset "Resources/app.js":
E/TiAssetHelper( 6716): java.io.FileNotFoundException: Resources/app.js
E/TiAssetHelper( 6716):
at android.content.res.AssetManager.openAsset(Native Method)
E/TiAssetHelper( 6716):
at android.content.res.AssetManager.open(AssetManager.java:315)
E/TiAssetHelper( 6716):
at android.content.res.AssetManager.open(AssetManager.java:289)
E/TiAssetHelper( 6716):
at org.appcelerator.kroll.util.KrollAssetHelper.readAsset(KrollAssetHelper.java:77)
E/TiAssetHelper( 6716):
at org.appcelerator.titanium.TiLaunchActivity.loadActivityScript(TiLaunchActivity.java:104)
E/TiAssetHelper( 6716):
at org.appcelerator.titanium.TiLaunchActivity.windowCreated(TiLaunchActivity.java:152)
E/TiAssetHelper( 6716):
at org.appcelerator.titanium.TiRootActivity.windowCreated(TiRootActivity.java:109)
E/TiAssetHelper( 6716):
at org.appcelerator.titanium.TiBaseActivity.onCreate(TiBaseActivity.java:506)
E/TiAssetHelper( 6716):
at org.appcelerator.titanium.TiLaunchActivity.onCreate(TiLaunchActivity.java:145)
E/TiAssetHelper( 6716):
at org.appcelerator.titanium.TiRootActivity.onCreate(TiRootActivity.java:97)
E/TiAssetHelper( 6716):
at android.app.Activity.performCreate(Activity.java:4470)
E/TiAssetHelper( 6716):
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1053)
E/TiAssetHelper( 6716):
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1934)
E/TiAssetHelper( 6716):
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1995)
E/TiAssetHelper( 6716):
at android.app.ActivityThread.access$600(ActivityThread.java:128)
E/TiAssetHelper( 6716):
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1161)
E/TiAssetHelper( 6716):
at android.os.Handler.dispatchMessage(Handler.java:99)
E/TiAssetHelper( 6716):
at android.os.Looper.loop(Looper.java:137)
E/TiAssetHelper( 6716):
at android.app.ActivityThread.main(ActivityThread.java:4517)
E/TiAssetHelper( 6716):
at java.lang.reflect.Method.invokeNative(Native Method)
E/TiAssetHelper( 6716):
at java.lang.reflect.Method.invoke(Method.java:511)
E/TiAssetHelper( 6716):
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:980)
E/TiAssetHelper( 6716):
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:747)
E/TiAssetHelper( 6716):
at dalvik.system.NativeStart.main(Native Method)
E/TiAssetHelper( 6716): Error while reading asset "Resources/app.js":
E/TiAssetHelper( 6716): java.io.FileNotFoundException: Resources/app.js
E/TiAssetHelper( 6716):
at android.content.res.AssetManager.openAsset(Native Method)
E/TiAssetHelper( 6716):
at android.content.res.AssetManager.open(AssetManager.java:315)
E/TiAssetHelper( 6716):
at android.content.res.AssetManager.open(AssetManager.java:289)
E/TiAssetHelper( 6716):
at org.appcelerator.kroll.util.KrollAssetHelper.readAsset(KrollAssetHelper.java:77)
E/TiAssetHelper( 6716):
at org.appcelerator.kroll.runtime.v8.V8Runtime.nativeRunModule(Native Method)
E/TiAssetHelper( 6716):
at org.appcelerator.kroll.runtime.v8.V8Runtime.doRunModule(V8Runtime.java:140)
E/TiAssetHelper( 6716):
at org.appcelerator.kroll.KrollRuntime.handleMessage(KrollRuntime.java:289)
E/TiAssetHelper( 6716):
at org.appcelerator.kroll.runtime.v8.V8Runtime.handleMessage(V8Runtime.java:166)
E/TiAssetHelper( 6716):
at android.os.Handler.dispatchMessage(Handler.java:95)
E/TiAssetHelper( 6716):
at android.os.Looper.loop(Looper.java:137)
E/TiAssetHelper( 6716):
at org.appcelerator.kroll.KrollRuntime$KrollRuntimeThread.run(KrollRuntime.java:112)
The same project without the --skip-js-minify flag will function as expected. The error (in my code on line 31) was showing as being on line 2 (different from iOS, showing line 1) indicating that the minify was working.
Steps to reproduce
1) Create a project with error in the code, such as:
var a = new Array(0x100000000);
2) Package for target dist-playstore
3) Install resulting apk onto device
4) Monitor logcat
5) Launch app
Result:
Application failure missing app.js
Expected:
Application failure caused by error in code, line number output in log cat
3.0.x pull request: https://github.com/appcelerator/titanium_mobile/pull/3879
Verified fixed on windows, linux and mac with: CLI: 3.0.24-cr Titanium SDK version 3.0.2.v20130215190201 Titanium Studio, build: 3.0.2.201302041757 Mac OS 10.8.2 Windows 7 Ubuntu 12.04