Details

      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

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                cbarber Chris Barber
                Reporter:
                emerriman Eric Merriman
                Reviewer:
                Allen Yeung
              • Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Backbone Issue Sync

                  • Titanium SDK/CLI <> Titanium Mobile
                    Synced with:
                    TIMOB-15668
                    Sync status:
                    ERROR
                    Last received:
                    Last sent:

                    Git Source Code