You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cordova.apache.org by "Andrew Grieve (JIRA)" <ji...@apache.org> on 2013/04/15 19:58:16 UTC

[jira] [Commented] (CB-3030) FileReader.readAsText fails with JSON error

    [ https://issues.apache.org/jira/browse/CB-3030?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13631935#comment-13631935 ] 

Andrew Grieve commented on CB-3030:
-----------------------------------

What version of cordova are you seeing this with? Could it be that you did an update of the native side of your app without updating the cordova.js part? 

We started always passing the params in this change:
https://git-wip-us.apache.org/repos/asf?p=cordova-js.git;a=commit;h=1d87907716be8ab1b2fec4de3296a84196109bf1
                
> FileReader.readAsText fails with JSON error
> -------------------------------------------
>
>                 Key: CB-3030
>                 URL: https://issues.apache.org/jira/browse/CB-3030
>             Project: Apache Cordova
>          Issue Type: Bug
>          Components: Android
>    Affects Versions: Master
>            Reporter: Vladimir Avdonin
>            Assignee: Joe Bowser
>         Attachments: index.html
>
>
> When called to read the whole file readAsText fails with "JASON error". exception is thrown from JSONArray.get(int), called from FileUtils.java:113 from the following code:
> int start = args.getInt(2);
> The reason is args at this point does not have 2 elements. It appears that readAsText expects start and stop arguments to be always present, while caller in cordova.js only adds these arguments when not full file is read. readAsDataURL has the same problem.
> Test program attached.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira