Jeff Schwartz
unread,May 17, 2012, 11:57:02 AM5/17/12Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to phonegap
Phonegap-ers,
I've found a very mysterious error when using camera.getPicture in
Cordova 1.7.0 for iOS.
Everything appears to work correctly, except I get a stray JavaScript
error message
and alert box because of a window.onerror handler I added for
debugging purposes.
The error appears to be:
wait_fences: failed to receive reply: 10004003
I also added a window.onerror handler before cordova and I get this
JavaScript Error:
TypeError: 'undefined' is not a function
I believe the wait_fences is the actual error. I've been through the
cordova-1.7.0.js file
pretty thoroughly and can't seem to isolate the error. It is
happening before the 'callbackSuccess'
method.
To reproduce the error:
1) Generate a new cordova 1.7 project.
2) Change the Deployment Target to 4.3
3) Run the project
4) Quit the simulator
4) Modify the www/index.html as follows
5a) Add window.onerror handler
...
<script>window.onerror = function(error) { alert(error); };</script>
<!-- Add this line above cordova -->
<script type="text/javascript" charset="utf-8"
src="cordova-1.7.0.js"></script>
5b) Modify onDeviceReady as below
function onDeviceReady() {
navigator.camera.getPicture(onSuccess, onFail, {});
function onSuccess(imageUri) {
console.log('onSuccess: ' + imageUri);
}
function onFail(message) {
console.log('Failed because: ' + message);
}
}
6) Attach a device with camera and run on device.
7) Take a picture
8) Tap the "Use" button
9) Alert box appears
10) Error happens
11) The log after running the app
2012-05-17 11:42:09.894 TestCamera[178:707] Multi-tasking -> Device:
YES, App: YES
wait_fences: failed to receive reply: 10004003
2012-05-17 11:42:46.088 TestCamera[178:707] [INFO] onSuccess:
file://localhost/var/mobile/Applications/435FBFA2-6382-4DD5-B2A7-97B6FA94DCB1/tmp/photo_004.jpg
I've been through the cordova-1.7.0.js file extensively. I tried
rebooting the device. Nothing seems to work. Note that lowering the
Deployment Target to 3.0 still gives the JavaScript alert error, but
not the wait_fences error.
When running in the Simulator the onFail handler runs as expected.
All of my test iPhones and iPads are on iOS 5 or newer.
Any help would be greatly appreciated.
Thanks in advance.
Sincerely,
Jeff Schwartz