Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-25796] Windows: Adding a hyperloop created UI element to a View multiple times throws an error

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionFixed
Resolution Date2018-08-22T00:25:44.000+0000
Affected Version/sRelease 7.1.0, Release 7.0.2, Release 7.2.0
Fix Version/sRelease 7.5.0
ComponentsHyperloop, Windows
Labelsn/a
ReporterEwan Harris
AssigneeKota Iguchi
Created2018-02-22T14:39:01.000+0000
Updated2018-08-22T00:25:49.000+0000

Description

Description

Adding a HL created view to a Titanium view multiple times throws the following error
[ERROR] :  ----- Titanium Javascript Runtime Error -----
[ERROR] :  Message: Uncaught Error: Runtime Error: add: unknown exception
var win = Ti.UI.createWindow();
var Canvas = require('Windows.UI.Xaml.Controls.Canvas');
var view = Ti.UI.createView({
    backgroundColor: 'white'
});
var SolidColorBrush = require('Windows.UI.Xaml.Media.SolidColorBrush');
var Colors = require('Windows.UI.Colors');
var box = new Canvas();
box.Background = new SolidColorBrush(Colors.Red);
box.Width = 50;
box.Height = 50;
win.addEventListener('click', function () {
    view.add(box);
});
win.add(view);
win.open();

Steps to reproduce

1. Add the above code to an existing classic project with hyperloop setup 2. Build for any Windows target 3. Click the view when the app launches 4. Click the view again a second time

Actual

Error shown above is thrown on the second click

Expected

No error should be thrown

Comments

  1. Kota Iguchi 2018-02-26

    https://github.com/appcelerator/titanium_mobile_windows/pull/1204
  2. Josh Longton 2018-07-20

    *Closing ticket.* The fix is present in SDK: {noformat} 7.4.0.v20180718223310 {noformat} *ENV* {noformat} Noka lumia 550 (Win 10) Ws-emulator Windows 10 Pro: 1803 Appc NPM: 4.2.13 Appc CLI: 7.0.4 Ti CLI Ver: 5.1.1 Node Ver: 8.9.1 NPM Ver: 6.1.0 {noformat}
  3. Kota Iguchi 2018-08-22

    Reopening this, just to update fixVersion.

JSON Source