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

Android: FileNotFoundExceptions should not be inside the Titanium log

    Details

    • Type: Bug
    • Status: In Review
    • Priority: Medium
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: Android
    • Labels:
      None
    • Story Points:
      3
    • Sprint:
      2017 Sprint 18 SDK, 2017 Sprint 19 SDK, 2017 Sprint 20 SDK, 2017 Sprint 21 SDK, 2017 Sprint 22 SDK, 2017 Sprint 23 SDK, 2017 Sprint 24 SDK, 2017 Sprint 25 SDK, 2017 Sprint 26 SDK, 2018 Sprint 01 SDK, 2018 Sprint 02 SDK

      Description

      When referencing a file that does not exist (let's say in a Ti.UI.ImageView), we should only log one error message to say it does not exist - which we do, but we also log like 30 lines exception-logs and two additional warnings that do not help the developer in any case and only spams the console. To clean this little but annoying issue, we could just adjust the log by leaving out the 3rd parameter that uses the exception-log.

      Example of a log:

      [ERROR] TiDrawableReference: (main) [100,100] Problem opening stream with url logo.png: Resources/logo.png
      [ERROR] TiDrawableReference: java.io.FileNotFoundException: Resources/logo.png
      [ERROR] TiDrawableReference: 	at android.content.res.AssetManager.openAsset(Native Method)
      [ERROR] TiDrawableReference: 	at android.content.res.AssetManager.open(AssetManager.java:347)
      [ERROR] TiDrawableReference: 	at android.content.res.AssetManager.open(AssetManager.java:321)
      [ERROR] TiDrawableReference: 	at org.appcelerator.titanium.util.TiFileHelper.openInputStream(TiFileHelper.java:222)
      [ERROR] TiDrawableReference: 	at org.appcelerator.titanium.view.TiDrawableReference.getInputStream(TiDrawableReference.java:860)
      [ERROR] TiDrawableReference: 	at org.appcelerator.titanium.view.TiDrawableReference.getBitmap(TiDrawableReference.java:316)
      [ERROR] TiDrawableReference: 	at org.appcelerator.titanium.view.TiDrawableReference.getBitmap(TiDrawableReference.java:300)
      [ERROR] TiDrawableReference: 	at org.appcelerator.titanium.view.TiDrawableReference.getBitmap(TiDrawableReference.java:284)
      [ERROR] TiDrawableReference: 	at org.appcelerator.titanium.view.TiDrawableReference.getDrawable(TiDrawableReference.java:497)
      [ERROR] TiDrawableReference: 	at ti.modules.titanium.ui.widget.TiToolbar.handleSetLogo(TiToolbar.java:238)
      [ERROR] TiDrawableReference: 	at ti.modules.titanium.ui.widget.TiToolbar.setLogo(TiToolbar.java:227)
      [ERROR] TiDrawableReference: 	at ti.modules.titanium.ui.widget.TiToolbar.propertyChanged(TiToolbar.java:559)
      [ERROR] TiDrawableReference: 	at org.appcelerator.kroll.KrollProxy.firePropertyChanged(KrollProxy.java:928)
      [ERROR] TiDrawableReference: 	at org.appcelerator.kroll.KrollProxy.onPropertyChanged(KrollProxy.java:1016)
      [ERROR] TiDrawableReference: 	at org.appcelerator.kroll.runtime.v8.V8Object.nativeFireEvent(Native Method)
      [ERROR] TiDrawableReference: 	at org.appcelerator.kroll.runtime.v8.V8Object.fireEvent(V8Object.java:62)
      [ERROR] TiDrawableReference: 	at org.appcelerator.kroll.KrollProxy.doFireEvent(KrollProxy.java:921)
      [ERROR] TiDrawableReference: 	at org.appcelerator.kroll.KrollProxy.handleMessage(KrollProxy.java:1144)
      [ERROR] TiDrawableReference: 	at org.appcelerator.titanium.proxy.TiViewProxy.handleMessage(TiViewProxy.java:363)
      [ERROR] TiDrawableReference: 	at org.appcelerator.titanium.proxy.TiWindowProxy.handleMessage(TiWindowProxy.java:116)
      [ERROR] TiDrawableReference: 	at ti.modules.titanium.ui.WindowProxy.handleMessage(WindowProxy.java:452)
      [ERROR] TiDrawableReference: 	at android.os.Handler.dispatchMessage(Handler.java:98)
      [ERROR] TiDrawableReference: 	at android.os.Looper.loop(Looper.java:154)
      [ERROR] TiDrawableReference: 	at android.app.ActivityThread.main(ActivityThread.java:6119)
      [ERROR] TiDrawableReference: 	at java.lang.reflect.Method.invoke(Native Method)
      [ERROR] TiDrawableReference: 	at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:886)
      [ERROR] TiDrawableReference: 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:776)
      [WARN]  TiDrawableReference: (main) [0,100] Could not open stream to get bitmap
      [WARN]  TiDrawableReference: (main) [0,100] Could not open stream to get bitmap
      

        Attachments

          Activity

            People

            • Assignee:
              cwilliams Christopher Williams
              Reporter:
              hknoechel Hans Knöchel
              Reviewer:
              Hans Knöchel
            • Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:

                Git Source Code