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

Android: Reading TextField "backgroundDisabledColor" will crash if background/border color is assigned

    Details

    • Story Points:
      3
    • Sprint:
      2019 Sprint 5, 2019 Sprint 6, 2019 Sprint 7, 2019 Sprint 8, 2019 Sprint 9, 2019 Sprint 10

      Description

      Using Android SDK 7.5.0, text field touch start event is failing with below error.

      [WARN] :   Settings: mValues not put! needsGenerationTracker: true currentGeneration: -1 name: enable_navbar value: null
      [ERROR] :  TiExceptionHandler: (main) [39572,39572] ti:/titanium.js:207
      [ERROR] :  TiExceptionHandler: 			serialized[k] = this[k];
      [ERROR] :  TiExceptionHandler:                        ^
      [ERROR] :  TiExceptionHandler: Error: android.graphics.drawable.PaintDrawable cannot be cast to android.graphics.drawable.StateListDrawable
      [ERROR] :  TiExceptionHandler:     at TextField.value (ti:/titanium.js:207:24)
      [ERROR] :  TiExceptionHandler:     at JSON.stringify (<anonymous>)
      [ERROR] :  TiExceptionHandler:     at TextField.<anonymous> (/app.js:23:20)
      [ERROR] :  TiExceptionHandler:     at TextField.value (ti:/events.js:49:21)
      [ERROR] :  TiExceptionHandler:     at TextField.value (ti:/events.js:101:19)
      [ERROR] :  TiExceptionHandler:
      [ERROR] :  TiExceptionHandler:     org.appcelerator.titanium.proxy.TiViewProxy.getBackgroundDisabledColor(TiViewProxy.java:1190)
      [ERROR] :  TiExceptionHandler:     org.appcelerator.kroll.runtime.v8.V8Object.nativeFireEvent(Native Method)
      [ERROR] :  TiExceptionHandler:     org.appcelerator.kroll.runtime.v8.V8Object.fireEvent(V8Object.java:63)
      [ERROR] :  TiExceptionHandler:     org.appcelerator.kroll.KrollProxy.doFireEvent(KrollProxy.java:971)
      [ERROR] :  TiExceptionHandler:     org.appcelerator.kroll.KrollProxy.handleMessage(KrollProxy.java:1196)
      [ERROR] :  TiExceptionHandler:     org.appcelerator.titanium.proxy.TiViewProxy.handleMessage(TiViewProxy.java:401)
      [ERROR] :  TiExceptionHandler:     ti.modules.titanium.ui.TextFieldProxy.handleMessage(TextFieldProxy.java:157)
      [ERROR] :  TiExceptionHandler:     android.os.Handler.dispatchMessage(Handler.java:104)
      [ERROR] :  TiExceptionHandler:     android.os.Looper.loop(Looper.java:166)
      [ERROR] :  TiExceptionHandler:     android.app.ActivityThread.main(ActivityThread.java:7425)
      [INFO] :   zygote64: Do partial code cache collection, code=30KB, data=30KB
      

      Test steps:

      1. Create a new project
      2. Paste the sample test code and run on android device
      3. After running, start touching on the text field and got the error.

      Test code:

      var win = Ti.UI.createWindow({ 
      backgroundColor : 'gray' 
      }); 
       
       
      var view = Ti.UI.createView({ 
      height : Ti.UI.SIZE, 
      borderColor : "red", 
      width : Ti.UI.FILL, 
      layout : "vertical" 
      }); 
       
       
      var TF = Ti.UI.createTextField({ 
      height : 40, 
      width : Ti.UI.FILL, 
      backgroundColor : "#FAFAFA", 
      borderColor : "black", 
      top : 20 
      }); 
      TF.addEventListener("touchstart", function(e) { 
      	
      Ti.API.debug(JSON.stringify(e)); 
      }); 
      win.add(TF); 
       
      win.add(view); 
      win.open();
      

      Test Environment:

      Appcelerator Command-Line Interface, version 7.0.9
      Operating System
        Name                        = Mac OS X
        Version                     = 10.13.6
        Architecture                = 64bit
        # CPUs                      = 4
        Memory                      = 8589934592
      Node.js
        Node.js Version             = 8.9.1
        npm Version                 = 5.5.1
      Titanium CLI
        CLI Version                 = 5.1.1
      Titanium SDK
        SDK Version                 = 7.5.0.GA
        SDK Path                    = /Users/sharifabudarda/Library/Application Support/Titanium/mobilesdk/osx/7.5.0.GA
        Target Platform             = android
      

      Device:Huawei Y9 2018

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                ybanev Yordan Banev
                Reporter:
                rmitro Rakhi Mitro
                Reviewer:
                Gary Mathews
                Tester:
                Keerthi Mahalingam
              • Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Backbone Issue Sync

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

                    Git Source Code