[AC-2474] Calling Ti.Platform.openURL throws Unknown Java Exception
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | n/a |
Status | Closed |
Resolution | Cannot Reproduce |
Resolution Date | 2014-01-19T08:06:12.000+0000 |
Affected Version/s | n/a |
Fix Version/s | n/a |
Components | Titanium SDK & CLI |
Labels | android, defect, studio3 |
Reporter | Van Thompson |
Assignee | Shak Hossain |
Created | 2013-11-22T12:42:29.000+0000 |
Updated | 2016-03-08T07:41:31.000+0000 |
Description
I am just trying to open a browser using the following command:
Ti.Platform.openURL("http://www.google.com");
Really nothing fancy. I've tried without 'http' and with different URLs. This happens on the emulator and a device. I've tried with Android 4.0.3 and 4.2 with the same result.
Attachments
File | Date | Size |
---|---|---|
openURL.PNG | 2013-11-22T12:42:29.000+0000 | 91996 |
stack.PNG | 2013-11-22T15:25:15.000+0000 | 9489 |
studioStack.PNG | 2013-11-22T16:17:28.000+0000 | 35819 |
Titanium openURL problem.docx | 2013-12-16T20:23:11.000+0000 | 226960 |
More information: If I put Ti.Platform.openURL on my first window, it works as expected. I placed the same code on the second window in the app and I get the Unknown Java exception.
Hello, as you mentioned, when we test, it just works. Please share with us the structure of your code or similar, so we can reproduce this. Best, Mauro
I've uploaded the code without images. The offending line is on controller/OrdersController.js line 32.
Hello, I'm testing your code and: - We don't have any login/user. - In the line before the openURL, you are building a url with a local prefix for a maps app, right? Did you tried to open that one directly in the browser or similar to see if that's the problem? - Please add a try-catch so you can get more info on what failed in the openURL. Your app is not suitable to be used as testcase, because of its complexity. If possible, please remove it from this ticket, since you have a lot of information that looks like is private, and this is a public forum. Best, Mauro
I have removed the source code. I've tried a simple url such as http://www.google.com with the same result (as shown in 'openURL.png'). Any stack trace info I was able to retrieve is in the other two images I posted. I also built the url, copied it, and pasted it into a browser. It loaded fine.
One other thing...I get the same error when my URL is a telephone number (tel://7705551212).
Hello Van, if you create a simple testcase with Titanium, and use the openURL, are you able to reproduce the issue? i.e., is it a windows 8 focused issue? If that doesn't fail for you, then is something else in your code, but let's test the above sample and then we decide how to proceed on this. Thanks! Best, Mauro
Mauro I did that as well and it's hit or miss. I've placed code on the first window of the app that opens google via openURL. I proceeded to the next window and did the same. It worked. I can't find a rhyme or reason for it. Initially I thought it had something to do with the code being in a custom event but I tried that as well. I will try a few other simple scenarios. Thanks Van
Mauro I've attached a document containing the results of adding very simple buttons that attempt to open google.com using Ti.Platform.openURL('http://www.google.com'). I hope it will be helpful. Thanks Van
We tried to reproduce this issue with the code below. We can't reproduce this problem with latest 3.2.0 GA release. Please try this sample code and let us know if the issue persists.
Testing Environment:
Android SDK: 4.2.2 Titanium SDK: 3.2.0.GA Titanium CLI Version: 3.2.0Test Code
Steps to Test:
1. Create a sample project, 2. Paste this code in app.js file. 3. Run this with testing environment. 4. Click on URL test buttonI will do this, however, I have already done something similar and the code does work. I have placed similar code in the app in question and have seen openURL work as expected (see 'Titanium openURL problem.docx' attachment). The problem is I still get the previously reported java exception. I fully acknowledge it has something to do with my application, however, I do not believe the exception is being thrown because of the way I am calling openURL. I updated to 3.2.0.GA today hoping it would fix the issue. No luck.
[~vandert] We have been unable to reproduce this issue with numerous permutations. We need a minimal but complete test case that can reproduce this issue. We would be happy to investigate this issue further once we have a reproducible test.
Closing since we can't reproduce the issue with our sample and the reporter has not provided a sample to reproduce the error.