[
https://issues.apache.org/jira/browse/CB-1084?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13420816#comment-13420816
]
Filip Maj commented on CB-1084:
-------------------------------
There are two issues with your example Stefan.
1. As Joe mentioned, your test is not tied to the Cordova {{deviceready}}
event. This event is imperative to all Cordova applications. Cordova requires a
bit of time to initialize itself, specifically it needs time to set up the
webview-to-native bridge, as well as create all of the JavaScript objects that
make up the Cordova API and hook them into various spots on the {{window}}
object for users like you to be able to use it. Please take a read through the
documentation about the
[deviceready|http://docs.phonegap.com/en/2.0.0/cordova_events_events.md.html#deviceready]
event.
2. {{window.requestFileSystem}} is one method that the Cordova API provides,
but like I mentioned above, until the {{deviceready}} event fires, it will be
undefined on certain platforms (like Android).
{{window.webkitRequestFileSystem}} is probably a stub that made its way into
the Android WebView but I would not rely on it working. It does not surprise me
it is causing your application to crash.
I highly recommend you take a look at the [PhoneGap documentation for
requestFileSystem|http://docs.phonegap.com/en/2.0.0/cordova_file_file.md.html#LocalFileSystem],
specifically the Full Example. In that example you can see that before
{{requestFileSystem}} is called, we attach to the {{deviceready}} _first and
foremost_, and then only after that event fires do we start using the File API.
Hope that is helpful.
Cheers,
Fil
> ICS TouchWiz - Reading/Writing files causes signal 11
> -----------------------------------------------------
>
> Key: CB-1084
> URL: https://issues.apache.org/jira/browse/CB-1084
> Project: Apache Cordova
> Issue Type: Bug
> Components: Android
> Affects Versions: 1.9.0
> Environment: This is on TouchWiz only on ICS, not on all of Android.
> Reporter: Stefan Kendall
> Assignee: Joe Bowser
> Priority: Minor
> Attachments: Archive.zip, project.tar.gz
>
>
> I've narrowed down this signal 11 crashing bug to the reading and writing of
> data from files.
> With a Samsung Galaxy S2 on 2.3.6, the app boots and shows 'hello'. On CM7
> and CM9, the app also boots. On ICS with TouchWiz, the app crasshes with
> 'signal 11' before anything renders.
> I've attached a project where the issue is reproduced.
--
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