Titanium JIRA Archive
Alloy (ALOY)

[ALOY-1653] Runtime error on Android when using optiondialog and not declaring destructive or cancel properties

GitHub Issuen/a
TypeBug
PriorityNone
StatusClosed
ResolutionFixed
Resolution Date2019-06-19T14:49:42.000+0000
Affected Version/sn/a
Fix Version/sCLI Release 7.1.0, Alloy 1.14.0
Componentsn/a
Labelsregression
ReporterEwan Harris
AssigneeEwan Harris
Created2019-03-20T17:34:45.000+0000
Updated2019-06-19T14:49:42.000+0000

Description

Description

When running kitchensink on Android and clicking an option dialog button I'm getting the below error. It looks to be because the destructive/cancel properties aren't defined so we're setting them to null, we shouldn't set these properties if they aren't defined in the xml
[ERROR] InputEventReceiver: Exception dispatching input event.
[ERROR] E/MessageQueue-JNI: Exception in MessageQueue callback: handleReceiveCallback
[ERROR] E/MessageQueue-JNI: java.lang.NumberFormatException: Unable to convert null
[ERROR] E/MessageQueue-JNI: 	at org.appcelerator.titanium.util.TiConvert.toInt(TiConvert.java:419)
[ERROR] E/MessageQueue-JNI: 	at ti.modules.titanium.ui.widget.TiUIDialog.handleEvent(TiUIDialog.java:364)
[ERROR] E/MessageQueue-JNI: 	at ti.modules.titanium.ui.widget.TiUIDialog$1.onClick(TiUIDialog.java:122)

Steps to reproduce

1. Build kitchensink 2. Click option dialog 3. Open the option dialog 4. Select an option

Actual

Above error

Expected

No error

Comments

  1. Ewan Harris 2019-03-21

    https://github.com/appcelerator/alloy/pull/926
  2. Samir Mohammed 2019-06-19

    *Closing ticket*, Fix verified in CLI Version 7.1.0-master.21 No runtime error was seen on KitchenSink-v2 when testing the 'option dialog' section. *Test Steps* 1. Built kitchensink-v2 2. Clicked on the option dialog 3. Opened the option dialog 4. Selected an option 5. Able to see no run time error and the console displayed its index number (selected each option)
       [INFO]   Ti.UI.OptionDialog selected option at index: 1
       [INFO]   Ti.UI.OptionDialog selected option at index: 2
       [INFO]   Ti.UI.OptionDialog selected option at index: 0
       
    *Test Environment*
       SDK: 8.0.2.GA
       Operating System
         Name                        = Mac OS X
         Version                     = 10.14.4
         Architecture                = 64bit
         CPUs                      = 8
         Memory                      = 16.0GB
       Node.js
         Node.js Version             = 10.13.0
         npm Version                 = 6.4.1
       Appcelerator CLI
         Installer                   = 4.2.14-3
         Core Package                = 7.1.0-master.21
       Titanium CLI
         CLI Version                 = 5.2.1
         node-appc Version           = 0.2.49
       

JSON Source