Closed MatAtBread closed 9 years ago
Can you enable exception breakpoints in your XCode to figure out where exactly is crashing the app? You can follow this guide: https://developer.apple.com/library/ios/recipes/xcode_help-breakpoint_navigator/articles/adding_an_exception_breakpoint.html
Actually, I can't (right now). The phone this occurs on is not mine, and until I get around to fixing my other code, updating Xcode to 5.1 to handle the iOS 7.1 SDK breaks my build (it's a Cordova app, and this is a know issue with Cordova 3.4 not building under Xcode 5.1). So I'm currently stuck on Cordova 3.4, Xcode 5.0.2 and IOS SDK 7.0.6.
When Cordova fix their issue, I'll be able to Xcode, iOS SDK and hopefully see this go pop in a debugger.
I'm seeing this as well XCode 5.1.1 iPhone 5 iOS 7.1
I've been trying to debug this a bit, enabling an exception breakpoint.
I'm a bit new to XCode debugging, but since I found this "EXC_BAD_ACCESS" http://stackoverflow.com/questions/1622079/break-on-exc-bad-access-in-xcode
So after [x] Enable Zombie Objects in my Debug Scheme, I see this in the log:
*** -[CaptureBarcodesViewController respondsToSelector:]: message sent to deallocated instance 0xa316750
I see a number of Deprecation warnings in CDVBarcodeScanner.mm
& CaptureBarcodesViewController.m
(though there are some for a couple of core Cordova plugins as well)
https://www.dropbox.com/s/rsou6zzn40hrd3b/Screenshot%202014-04-17%2012.30.39.png
@jonathannaguin could you please confirm you've read this issue?
Is this project abandoned?
I will try to fix this issue today. It seems that a deallocated instance is being called somewhere...
I have just committed some changes, can you give a try? Also, what steps do you follow to make crash the app?
I've just pulled, removed and re-added the plugin, and I'm getting the following at startup. This might be because I've just removed and re-added the plugin (I find Cordova on iOS really bad for this kind of issue). I've checked the source and generated config.xml and they look OK, but there's probably a problem somewhere....
If you have any ideas, this is what I see in the Xcode console:
2014-04-24 12:39:41.547 favr·tt[283:60b] Finished load of: file:///var/mobile/Applications/D068BA78-5FA4-4733-A2A0-076A99EC9294/favr%C2%B7tt.app/www/app.html 2014-04-24 12:39:48.429 favr·tt[283:60b] CDVPlugin class CDVBarcodeScanner (pluginName: BarcodeScanner) does not exist. 2014-04-24 12:39:48.431 favr·tt[283:60b] ERROR: Plugin 'BarcodeScanner' not found, or is not a CDVPlugin. Check your plugin mapping in config.xml. 2014-04-24 12:39:48.433 favr·tt[283:60b] -[CDVCommandQueue executePending] [Line 158] FAILED pluginJSON = [ "BarcodeScanner1123602059", "BarcodeScanner", "scan", [
] ]
Hmmm I had that issue before, check that every .m or .mm source file is added to the Target.
$ rm -rf platforms/ios $ rm plugins/ios.json
Rebuild. That's what I do when things get wonky removing/adding plugins.
On Thursday, April 24, 2014, MatAtBread notifications@github.com wrote:
I've just pulled, removed and re-added the plugin, and I'm getting the following at startup. This might be because I've just removed and re-added the plugin (I find Cordova on iOS really bad for this kind of issue). I've checked the source and generated config.xml and they look OK, but there's probably a problem somewhere....
If you have any ideas, this is what I see in the Xcode console:
2014-04-24 12:39:41.547 favr·tt[283:60b] Finished load of: file:///var/mobile/Applications/D068BA78-5FA4-4733-A2A0-076A99EC9294/favr%C2%B7tt.app/www/app.html 2014-04-24 12:39:48.429 favr·tt[283:60b] CDVPlugin class CDVBarcodeScanner (pluginName: BarcodeScanner) does not exist. 2014-04-24 12:39:48.431 favr·tt[283:60b] ERROR: Plugin 'BarcodeScanner' not found, or is not a CDVPlugin. Check your plugin mapping in config.xml. 2014-04-24 12:39:48.433 favr·tt[283:60b] -[CDVCommandQueue executePending] [Line 158] FAILED pluginJSON = [ "BarcodeScanner1123602059", "BarcodeScanner", "scan", [
] ]
— Reply to this email directly or view it on GitHubhttps://github.com/jonathannaguin/BarcodeScanner/issues/5#issuecomment-41270518 .
Snet from Gmail Mobile
I got it to rebuild (basically removed stuff and added it again), but no luck - same issue: crashes after the scanner has closed.
It looks like it never crashes if the user presses "Cancel". Maybe take a look at the code path if the scanner succeeds? I'm still in this wierd XCode 5.0.1 / iOS 7.0.6 / iPhone 4 limbo. I can't attach the failing device (iPhone 5, iOS 7.1) to the debugger without (1) breaking my build, or (2) working out why the bulld breaks!
Ok...so I managed to build with Xcode 5.1.1, iOS 7.1 SDK and run on the offending device. I set the exception breakpoint, but it appears to only give the info on exit, even though the breakpoint is set to break on Throw, not Catch.
Attached is a screen grab of Xcode (this is not the way to do this, I know). The exception address (0x0000000C in the example), is not always that low (which looks like a nil pointer offset by 3 words?), but it is repeatable.
More stack trace??
Same here @MatAtBread
Apparently you're supposed to [x] Enable Zombie Objects for bugs of this nature. https://www.dropbox.com/s/ncenl3vo3gdvihu/Screenshot%202014-04-24%2010.10.01.png
I think it's related with the fact that I am closing the scanner once I read one barcode. This might be a problem if the scanner has read more than one.
I have just committed some changes, can you try again, please?
right away.
On Thu, Apr 24, 2014 at 10:16 AM, Jonathan Nuñez notifications@github.comwrote:
I have just committed some changes, can you try again, please?
— Reply to this email directly or view it on GitHubhttps://github.com/jonathannaguin/BarcodeScanner/issues/5#issuecomment-41284946 .
Chris Scott Transistor Software http://www.transistorsoft.com
Sure. Also....if I comment out the iOS version test in CDVBarcodeScanner::createScanner so it uses the <iOS 7 code in all cases, it works. I'll pull changes and try again. Also, see my stack traces (screen grabs) above - for some reason github didn't put them in chromo order.
Just pulled - latest version looks better. Removing my "fix" and using the iOS 7 code path, I've managed 5 scans in a row with no crash. This was possible, but unlikely before.
lgtm. :shipit:
I ve install the last version and it is ok to compile. But on execution on ios 7 with xcode 5.1.1, Cordova 3.4, i did see the view controller. in the console i have this : Warning: Attempt to present <CaptureBarcodesViewController: 0x18c42d90> on <MainViewController: 0x17566b10> whose view is not in the window hierarchy!
Do you have ever seen this ?
This only occurs on iPhone 5 (4,4s,5s,5c all seem ok), and happens a few hundred milliseconds after the scanner is closed.
Below is the iOS debug trace.
Any info you can provide to point us in the right direction much appreciated.
Matt