You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cordova.apache.org by "Thejaswi Puthraya (JIRA)" <ji...@apache.org> on 2012/07/11 06:24:36 UTC

[jira] [Created] (CB-1028) FileTransfer.upload WebKit discarded an uncaught exception

Thejaswi Puthraya created CB-1028:
-------------------------------------

             Summary: FileTransfer.upload WebKit discarded an uncaught exception
                 Key: CB-1028
                 URL: https://issues.apache.org/jira/browse/CB-1028
             Project: Apache Cordova
          Issue Type: Bug
          Components: iOS
    Affects Versions: 1.6.1
         Environment: OS X Lion, Xcode 4.3.2, iPhone iOS 5.1
            Reporter: Thejaswi Puthraya
            Assignee: Shazron Abdullah
            Priority: Critical
             Fix For: 1.7.0
         Attachments: phonegap_snippet.html

Unable to upload file to server using FileTransfer.upload.

The following code:

	var onSuccess, onError;

	options.destinationType = Camera.DestinationType.FILE_URI;

	onSuccess = function(imageURI) {
		Ext.get("uploaded_image_" + name).setStyle("background-image","url(" + imageURI + ")");

		app.views[name + "Form"].imageURI = imageURI;
	};
	
	onError = function(message) {
		console.log(message);
		Ext.Msg.alert("Camera", "There was a problem with the camera.");
	};

	navigator.camera.getPicture(onSuccess, onError, options);

	----

	var options = new FileUploadOptions();
	options.fileKey = "repair[image]";
	options.params = fix_form_names(form.getValues());

	var ft = new FileTransfer();

	ft.upload(form.imageURI, form.url, win, fail, options, true);

Returns the following error:

	*** WebKit discarded an uncaught exception in the webView:decidePolicyForNavigationAction:request:frame:decisionListener: delegate: <NSRangeException> *** -[JKArray objectAtIndex:]: index (4) beyond bounds (4)

This code was working on PhoneGap 1.4.1.

Further reports at https://groups.google.com/forum/?fromgroups#!topic/phonegap/w8SOE5IEr9o

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (CB-1028) FileTransfer.upload WebKit discarded an uncaught exception

Posted by "Thejaswi Puthraya (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CB-1028?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Thejaswi Puthraya updated CB-1028:
----------------------------------

          Description: 
I seem to be running into this issue with Cordova 1.9.0 on iOS. The traceback I get is::

2012-07-10 11:51:34.455 BuzzVote[3800:707] *** WebKit discarded an uncaught exception in the webView:decidePolicyForNavigationAction:request:frame:decisionListener: delegate: <NSRangeException> *** -[__NSCFString substringToIndex:]: Range or index out of bounds

Here's how I use the FileTransfer to reproduce the error.
For more information, I am using XCode 4.3.3, Cordova 1.9.0 and the iPad 2 Wifi with 5.1.1. Please check the enclosed phonegap_snippet.html to reproduce the error.

This is related to #543.

  was:
Unable to upload file to server using FileTransfer.upload.

The following code:

	var onSuccess, onError;

	options.destinationType = Camera.DestinationType.FILE_URI;

	onSuccess = function(imageURI) {
		Ext.get("uploaded_image_" + name).setStyle("background-image","url(" + imageURI + ")");

		app.views[name + "Form"].imageURI = imageURI;
	};
	
	onError = function(message) {
		console.log(message);
		Ext.Msg.alert("Camera", "There was a problem with the camera.");
	};

	navigator.camera.getPicture(onSuccess, onError, options);

	----

	var options = new FileUploadOptions();
	options.fileKey = "repair[image]";
	options.params = fix_form_names(form.getValues());

	var ft = new FileTransfer();

	ft.upload(form.imageURI, form.url, win, fail, options, true);

Returns the following error:

	*** WebKit discarded an uncaught exception in the webView:decidePolicyForNavigationAction:request:frame:decisionListener: delegate: <NSRangeException> *** -[JKArray objectAtIndex:]: index (4) beyond bounds (4)

This code was working on PhoneGap 1.4.1.

Further reports at https://groups.google.com/forum/?fromgroups#!topic/phonegap/w8SOE5IEr9o

          Environment: OS X Lion, Xcode 4.3.3, iPhone iOS 5.1  (was: OS X Lion, Xcode 4.3.2, iPhone iOS 5.1)
    Affects Version/s:     (was: 1.6.1)
                       1.9.0
    
> FileTransfer.upload WebKit discarded an uncaught exception
> ----------------------------------------------------------
>
>                 Key: CB-1028
>                 URL: https://issues.apache.org/jira/browse/CB-1028
>             Project: Apache Cordova
>          Issue Type: Bug
>          Components: iOS
>    Affects Versions: 1.9.0
>         Environment: OS X Lion, Xcode 4.3.3, iPhone iOS 5.1
>            Reporter: Thejaswi Puthraya
>            Assignee: Shazron Abdullah
>            Priority: Critical
>             Fix For: 1.7.0
>
>         Attachments: phonegap_snippet.html
>
>
> I seem to be running into this issue with Cordova 1.9.0 on iOS. The traceback I get is::
> 2012-07-10 11:51:34.455 BuzzVote[3800:707] *** WebKit discarded an uncaught exception in the webView:decidePolicyForNavigationAction:request:frame:decisionListener: delegate: <NSRangeException> *** -[__NSCFString substringToIndex:]: Range or index out of bounds
> Here's how I use the FileTransfer to reproduce the error.
> For more information, I am using XCode 4.3.3, Cordova 1.9.0 and the iPad 2 Wifi with 5.1.1. Please check the enclosed phonegap_snippet.html to reproduce the error.
> This is related to #543.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (CB-1028) FileTransfer.upload WebKit discarded an uncaught exception

Posted by "Andrew Grieve (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CB-1028?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13411892#comment-13411892 ] 

Andrew Grieve commented on CB-1028:
-----------------------------------

fixed in pull request: https://github.com/apache/incubator-cordova-ios/pull/32
                
> FileTransfer.upload WebKit discarded an uncaught exception
> ----------------------------------------------------------
>
>                 Key: CB-1028
>                 URL: https://issues.apache.org/jira/browse/CB-1028
>             Project: Apache Cordova
>          Issue Type: Bug
>          Components: iOS
>    Affects Versions: 1.9.0
>         Environment: OS X Lion, Xcode 4.3.3, iPhone iOS 5.1
>            Reporter: Thejaswi Puthraya
>            Assignee: Shazron Abdullah
>            Priority: Critical
>             Fix For: 2.0.0
>
>         Attachments: phonegap_snippet.html
>
>
> I seem to be running into this issue with Cordova 1.9.0 on iOS. The traceback I get is::
> 2012-07-10 11:51:34.455 BuzzVote[3800:707] *** WebKit discarded an uncaught exception in the webView:decidePolicyForNavigationAction:request:frame:decisionListener: delegate: <NSRangeException> *** -[__NSCFString substringToIndex:]: Range or index out of bounds
> Here's how I use the FileTransfer to reproduce the error.
> For more information, I am using XCode 4.3.3, Cordova 1.9.0 and the iPad 2 Wifi with 5.1.1. Please check the enclosed phonegap_snippet.html to reproduce the error.
> This is related to #543.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (CB-1028) FileTransfer.upload WebKit discarded an uncaught exception

Posted by "Andrew Grieve (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CB-1028?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13411803#comment-13411803 ] 

Andrew Grieve commented on CB-1028:
-----------------------------------

Looks like a bug in the escaping logic added in this commit: 
https://github.com/apache/incubator-cordova-ios/commit/626c2333e9bb47420c4dcd518f95b97d9f9a440c

It's triggered when your URL ends with a /. I'll put together a unit test + fix.
                
> FileTransfer.upload WebKit discarded an uncaught exception
> ----------------------------------------------------------
>
>                 Key: CB-1028
>                 URL: https://issues.apache.org/jira/browse/CB-1028
>             Project: Apache Cordova
>          Issue Type: Bug
>          Components: iOS
>    Affects Versions: 1.9.0
>         Environment: OS X Lion, Xcode 4.3.3, iPhone iOS 5.1
>            Reporter: Thejaswi Puthraya
>            Assignee: Shazron Abdullah
>            Priority: Critical
>             Fix For: 2.0.0
>
>         Attachments: phonegap_snippet.html
>
>
> I seem to be running into this issue with Cordova 1.9.0 on iOS. The traceback I get is::
> 2012-07-10 11:51:34.455 BuzzVote[3800:707] *** WebKit discarded an uncaught exception in the webView:decidePolicyForNavigationAction:request:frame:decisionListener: delegate: <NSRangeException> *** -[__NSCFString substringToIndex:]: Range or index out of bounds
> Here's how I use the FileTransfer to reproduce the error.
> For more information, I am using XCode 4.3.3, Cordova 1.9.0 and the iPad 2 Wifi with 5.1.1. Please check the enclosed phonegap_snippet.html to reproduce the error.
> This is related to #543.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (CB-1028) FileTransfer.upload WebKit discarded an uncaught exception

Posted by "Shazron Abdullah (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CB-1028?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Shazron Abdullah updated CB-1028:
---------------------------------

    Fix Version/s:     (was: 1.7.0)
                   2.0.0
    
> FileTransfer.upload WebKit discarded an uncaught exception
> ----------------------------------------------------------
>
>                 Key: CB-1028
>                 URL: https://issues.apache.org/jira/browse/CB-1028
>             Project: Apache Cordova
>          Issue Type: Bug
>          Components: iOS
>    Affects Versions: 1.9.0
>         Environment: OS X Lion, Xcode 4.3.3, iPhone iOS 5.1
>            Reporter: Thejaswi Puthraya
>            Assignee: Shazron Abdullah
>            Priority: Critical
>             Fix For: 2.0.0
>
>         Attachments: phonegap_snippet.html
>
>
> I seem to be running into this issue with Cordova 1.9.0 on iOS. The traceback I get is::
> 2012-07-10 11:51:34.455 BuzzVote[3800:707] *** WebKit discarded an uncaught exception in the webView:decidePolicyForNavigationAction:request:frame:decisionListener: delegate: <NSRangeException> *** -[__NSCFString substringToIndex:]: Range or index out of bounds
> Here's how I use the FileTransfer to reproduce the error.
> For more information, I am using XCode 4.3.3, Cordova 1.9.0 and the iPad 2 Wifi with 5.1.1. Please check the enclosed phonegap_snippet.html to reproduce the error.
> This is related to #543.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (CB-1028) FileTransfer.upload WebKit discarded an uncaught exception

Posted by "Andrew Grieve (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CB-1028?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13411790#comment-13411790 ] 

Andrew Grieve commented on CB-1028:
-----------------------------------

Having a look.
                
> FileTransfer.upload WebKit discarded an uncaught exception
> ----------------------------------------------------------
>
>                 Key: CB-1028
>                 URL: https://issues.apache.org/jira/browse/CB-1028
>             Project: Apache Cordova
>          Issue Type: Bug
>          Components: iOS
>    Affects Versions: 1.9.0
>         Environment: OS X Lion, Xcode 4.3.3, iPhone iOS 5.1
>            Reporter: Thejaswi Puthraya
>            Assignee: Shazron Abdullah
>            Priority: Critical
>             Fix For: 2.0.0
>
>         Attachments: phonegap_snippet.html
>
>
> I seem to be running into this issue with Cordova 1.9.0 on iOS. The traceback I get is::
> 2012-07-10 11:51:34.455 BuzzVote[3800:707] *** WebKit discarded an uncaught exception in the webView:decidePolicyForNavigationAction:request:frame:decisionListener: delegate: <NSRangeException> *** -[__NSCFString substringToIndex:]: Range or index out of bounds
> Here's how I use the FileTransfer to reproduce the error.
> For more information, I am using XCode 4.3.3, Cordova 1.9.0 and the iPad 2 Wifi with 5.1.1. Please check the enclosed phonegap_snippet.html to reproduce the error.
> This is related to #543.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Resolved] (CB-1028) FileTransfer.upload WebKit discarded an uncaught exception

Posted by "Shazron Abdullah (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CB-1028?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Shazron Abdullah resolved CB-1028.
----------------------------------

    Resolution: Fixed

Pull request integrated, fix commit:

http://git-wip-us.apache.org/repos/asf/incubator-cordova-ios/commit/3d248744
                
> FileTransfer.upload WebKit discarded an uncaught exception
> ----------------------------------------------------------
>
>                 Key: CB-1028
>                 URL: https://issues.apache.org/jira/browse/CB-1028
>             Project: Apache Cordova
>          Issue Type: Bug
>          Components: iOS
>    Affects Versions: 1.9.0
>         Environment: OS X Lion, Xcode 4.3.3, iPhone iOS 5.1
>            Reporter: Thejaswi Puthraya
>            Assignee: Shazron Abdullah
>            Priority: Critical
>             Fix For: 2.0.0
>
>         Attachments: phonegap_snippet.html
>
>
> I seem to be running into this issue with Cordova 1.9.0 on iOS. The traceback I get is::
> 2012-07-10 11:51:34.455 BuzzVote[3800:707] *** WebKit discarded an uncaught exception in the webView:decidePolicyForNavigationAction:request:frame:decisionListener: delegate: <NSRangeException> *** -[__NSCFString substringToIndex:]: Range or index out of bounds
> Here's how I use the FileTransfer to reproduce the error.
> For more information, I am using XCode 4.3.3, Cordova 1.9.0 and the iPad 2 Wifi with 5.1.1. Please check the enclosed phonegap_snippet.html to reproduce the error.
> This is related to #543.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira