2

I'm working on Titanium project build on sdk v9 for ios platform, and I'm getting this error when opening an external url with this function Titanium.Platform.openURL :

[ERROR] :  Script Error {
[ERROR] :      message = "undefined is not an object";
[ERROR] :      type = TypeError;
[ERROR] :  }

the problem is it's not telling where the issue is, can any one help please? Thanks in advance

hamza_rhd
  • 33
  • 5
  • are you using `setInterval` in the pause/resume events? – miga Jun 11 '20 at 16:46
  • No, shall I use this? – hamza_rhd Jun 11 '20 at 17:17
  • no, but there was the same question in TiSlack by a user that had this error in combination with setInterval. In case you are not using 9.0.3 try to update to that version. – miga Jun 11 '20 at 18:02
  • I'm already using the version 9.0.2 , will that make any difference? – hamza_rhd Jun 12 '20 at 08:13
  • 9.0.3 not 9.0.2. – miga Jun 12 '20 at 10:05
  • @hamza_rhd Were you able to figure out a resolution? I'm facing the same issue, any code executed after a Ti.Platform.openURL causes the "undefined is not an object" error with no stack trace. I tried upgrading to 9.0.3 but it made no difference. – Justin Jun 18 '20 at 00:12
  • I'm 99% sure that this is a Titanium bug... I've logged a ticket with a repro here: https://jira.appcelerator.org/browse/COMM-57 – Justin Jun 18 '20 at 00:32
  • @Justin of course it didn't make any difference, i couldn't find the best solution, the good thing that this issue don't appear on production and didn't make any crash – hamza_rhd Jun 18 '20 at 10:31

1 Answers1

2

You can get around this error (which seems like a Titanium bug) by specifying the second and third args of the openURL command:

Ti.Platform.openURL('http://maps.apple.com/maps?q=' + destinationAddress, null, () => { });
Justin
  • 17,670
  • 38
  • 132
  • 201