Uploaded image for project: 'Titanium SDK/CLI'
  1. Titanium SDK/CLI
  2. TIMOB-26716

Android: 'Error while reading asset' Can be seen intermittently when running certain Android applications

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Critical
    • Resolution: Fixed
    • Affects Version/s: Release 8.0.0
    • Fix Version/s: Release 8.0.0
    • Component/s: Android
    • Labels:
      None
    • Environment:

      APPC SDK: 8.0.0.v20190111035358
      Google pixel xl 7.1.1 sim
      APPC CLI: 7.0.9
      Operating System Name: Mac OS Mojave
      Operating System Version: 10.14.2
      Node.js Version: 8.9.1
      Xcode 10.1

      Description

      The following error can be seen intermittently when running certain Android applications on the latest SDK in 8_0_x. The application seems to work without any issues but the error is logged in the console.

      [ERROR] :  TiAssetHelper: Error while reading asset "Resources/node_modules/core-js/modules/web.dom.iterable.js":
      [ERROR] :  TiAssetHelper: java.io.FileNotFoundException: Resources/node_modules/core-js/modules/web.dom.iterable.js
      [ERROR] :  TiAssetHelper: 	at android.content.res.AssetManager.nativeOpenAsset(Native Method)
      [ERROR] :  TiAssetHelper: 	at android.content.res.AssetManager.open(AssetManager.java:744)
      [ERROR] :  TiAssetHelper: 	at android.content.res.AssetManager.open(AssetManager.java:721)
      [ERROR] :  TiAssetHelper: 	at org.appcelerator.kroll.util.KrollAssetHelper.readAsset(KrollAssetHelper.java:165)
      [ERROR] :  TiAssetHelper: 	at org.appcelerator.kroll.runtime.v8.V8Runtime.nativeRunModule(Native Method)
      [ERROR] :  TiAssetHelper: 	at org.appcelerator.kroll.runtime.v8.V8Runtime.doRunModule(V8Runtime.java:162)
      [ERROR] :  TiAssetHelper: 	at org.appcelerator.kroll.KrollRuntime.runModule(KrollRuntime.java:207)
      [ERROR] :  TiAssetHelper: 	at org.appcelerator.titanium.TiLaunchActivity.loadScript(TiLaunchActivity.java:97)
      [ERROR] :  TiAssetHelper: 	at org.appcelerator.titanium.TiRootActivity.loadScript(TiRootActivity.java:414)
      [ERROR] :  TiAssetHelper: 	at org.appcelerator.titanium.TiLaunchActivity.windowCreated(TiLaunchActivity.java:174)
      [ERROR] :  TiAssetHelper: 	at org.appcelerator.titanium.TiRootActivity.windowCreated(TiRootActivity.java:283)
      [ERROR] :  TiAssetHelper: 	at org.appcelerator.titanium.TiBaseActivity.onCreate(TiBaseActivity.java:767)
      [ERROR] :  TiAssetHelper: 	at org.appcelerator.titanium.TiLaunchActivity.onCreate(TiLaunchActivity.java:167)
      [ERROR] :  TiAssetHelper: 	at org.appcelerator.titanium.TiRootActivity.onCreate(TiRootActivity.java:260)
      [ERROR] :  TiAssetHelper: 	at android.app.Activity.performCreate(Activity.java:7136)
      [ERROR] :  TiAssetHelper: 	at android.app.Activity.performCreate(Activity.java:7127)
      [ERROR] :  TiAssetHelper: 	at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1271)
      [ERROR] :  TiAssetHelper: 	at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2893)
      [ERROR] :  TiAssetHelper: 	at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3048)
      [ERROR] :  TiAssetHelper: 	at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:78)
      [ERROR] :  TiAssetHelper: 	at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:108)
      [ERROR] :  TiAssetHelper: 	at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:68)
      [ERROR] :  TiAssetHelper: 	at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1808)
      [ERROR] :  TiAssetHelper: 	at android.os.Handler.dispatchMessage(Handler.java:106)
      [ERROR] :  TiAssetHelper: 	at android.os.Looper.loop(Looper.java:193)
      [ERROR] :  TiAssetHelper: 	at android.app.ActivityThread.main(ActivityThread.java:6669)
      [ERROR] :  TiAssetHelper: 	at java.lang.reflect.Method.invoke(Native Method)
      [ERROR] :  TiAssetHelper: 	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
      [ERROR] :  TiAssetHelper: 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)
      

      A test scenario: Note The error can also be shown using the kitchenSink-V2 application

      1. Clone the repo https://github.com/appcelerator-modules/titanium-web-dialog
      2. Build the module for android (CD in to the android directory of the module and run appc run --build-only)
      3. Add the module into the Titanium modules directory
      4. Create a new Titanium application
      5. Add the following in to the app.js

        var WebDialog = require('ti.webdialog');
         
        var win = Ti.UI.createWindow({
          backgroundColor: '#fff'
        });
         
        var btnOpenDialog = Ti.UI.createButton({
          title: 'Open Web Dialog'
        });
         
        win.add(btnOpenDialog);
         
        btnOpenDialog.addEventListener('click', function () {
          WebDialog.open({
            url: 'https://appcelerator.com',
            title: 'Hello World',
         
            // iOS 10+
            tintColor: 'red',
            barColor: 'green',
         
            // iOS 11+
            barCollapsingEnabled: false,
            dismissButtonStyle: WebDialog.DISMISS_BUTTON_STYLE_CLOSE
          });
        });
         
        WebDialog.addEventListener('open', function (event) {
          console.log('open: ' + JSON.stringify(event));
        });
         
        WebDialog.addEventListener('close', function (event) {
          console.log('close: ' + JSON.stringify(event));
        });
         
        win.open();
        

      6. Run the program using the latest SDK from 8_0_x
      7. Theirs a chance the above error will be shown in the console

      Actual result
      Sometimes the application logs the above error but application still works as expected.

      Expected result
      Application should run without any issues and console should not log any errors.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                jvennemann Jan Vennemann
                Reporter:
                smohammed Samir Mohammed
                Reviewer:
                Christopher Williams
                Tester:
                Lokesh Choudhary
              • Watchers:
                5 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Backbone Issue Sync

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

                    Git Source Code