ScanditSDKBarcodePicker alloc-init crash - ios

I have strange problem with my application which uses scandit SDK for barcode scanning.
The next line
ScanditSDKBarcodePicker *scanditSDKBarcodePicker = [[ScanditSDKBarcodePicker alloc] initWithAppKey:kAppKey];
crashes application with EXC_BAD_ACCESS code. Also I got next code as cause of app crash:
0xf0a9c: push {r7, lr}
0xf0a9e: add r7, sp, #0
0xf0aa0: movs r0, #1
0xf0aa2: movw r1, #65535
0xf0aa6: bl #-114 ; 0x000f0a38 __static_initialization_and_destruction_0(int, int)
0xf0aaa: pop {r7, pc}
0xf0aac: lsls r0, r6
Note: This problem does not happen every time the code is executed.

This is Christian from Scandit.
The EXC_BAD_ACCESS could be caused by a problem with the app key/license integration. Can you double-check that the license key and app key are properly integrated?
You might also want to double-check whether the problem also occurs with the demo app that comes with the free development kit of our ios barcode scanner - after you integrated the license there.

Related

What is the fix for a swiftUI ios app with Firebase framework error to build and run on a connected device?

What is the fix for a SwiftUI iOS app with Firebase framework error not allowing to build and run on connected devices?
Xcode builds and runs the code flawless in the Canvas panel and Simulator, but does not build and run on connected devices.
(on a new project)
Error Messages :
Thread 1 #0 0x00000001029172ac in __abort_with_payload ()
dyld`__abort_with_payload:
0x1029172a4 <+0>: mov x16, #0x209
0x1029172a8 <+4>: svc #0x80
-> 0x1029172ac <+8>: b.lo 0x1029172c8 ; <+36>
0x1029172b0 <+12>: stp x29, x30, [sp, #-0x10]!
0x1029172b4 <+16>: mov x29, sp
0x1029172b8 <+20>: bl 0x1029157d8 ; cerror_nocancel
0x1029172bc <+24>: mov sp, x29
0x1029172c0 <+28>: ldp x29, x30, [sp], #0x10
0x1029172c4 <+32>: ret
0x1029172c8 <+36>: ret'
debug area
dyld: Library not loaded: #rpath/FBLPromises.framework/FBLPromises
Referenced from: /private/var/containers/Bundle/Application/1ECE175B-46E5-4FC0-A28A-
BC3255C9F124/Bennett Application.app/Bennett Application
Reason: no suitable image found. Did find:
/private/var/containers/Bundle/Application/1ECE175B-46E5-4FC0-A28A-BC3255C9F124/Bennett
Application.app/Frameworks/FBLPromises.framework/FBLPromises: code signature invalid for
'/private/var/containers/Bundle/Application/1ECE175B-46E5-4FC0-A28A-BC3255C9F124/Bennett
Application.app/Frameworks/FBLPromises.framework/FBLPromises'
Also, when you deploy an iOS app to the store, will you encounter similar problems as above?
This error was simply fixed by upgrading to the Apple Developers Program.

Error using Watson Speech to Text in iOS application

I am trying to incorporate Watson Speech-to-Text into an iOS application. In the past I am able to use the SDK just fine however with the new release of Watson Developer Cloud I have not had any success.
I already created the service in Bluemix for Watson STT. In the iOS app, I pass in the credential and able to get the instance of STT, so connection is fine. Looking at the SDK, it appears that I only need to call startListening() to have the app started listening on the users' speech. However it throws an error immediately.
// Activate speech
stt.startListening()
Error message:
libswiftCore.dylib`_swift_retain_(swift::HeapObject*):
0x10108d1a0 <+0>: cbz x0, 0x10108d1b8 ; <+24>
0x10108d1a4 <+4>: add x8, x0, #8
0x10108d1a8 <+8>: ldxr w9, [x8]
0x10108d1ac <+12>: add w9, w9, #4
-> 0x10108d1b0 <+16>: stxr w10, w9, [x8]
0x10108d1b4 <+20>: cbnz w10, 0x10108d1a8 ; <+8>
0x10108d1b8 <+24>: ret
The error happens on the line with "->" and the message: com.apple.coreaudio.AQClient(6): EXC_BAD_ACCESS (code=2, address=0x1000e8008)
Appreciate any insight on this issue.

EXC_BAD_ACCESS in [FBSession dealloc] after deleting app from Facebook

My app uses Facebook to share and post likes. It works fine until I delete app from Facebook via Settings -> Apps.
The use case is the following: I authorize on Facebook via my app, do any social actions, keep app opened, delete app from Apps on Facebook, try to do like or share again.
Then the login dialog appears and in 50% of cases app crashes on [FBSession dealloc] (on Thread 1, as shown in Navigator). The stack trace looks like this:
0x141718: blx 0x850a90 ; symbol stub for: objc_msgSend
0x14171c: movw r0, #0x5586
0x141720: mov r1, r5
0x141722: movt r0, #0x92
0x141726: add r0, pc
0x141728: ldr r0, [r0]
0x14172a: ldr r0, [r4, r0]
0x14172c: blx 0x850a90 ; symbol stub for: objc_msgSend
0x141730: movw r0, #0x557a <<< EXC_BAD_ACCESS
It turns out, that before crash FBSession is in the FBSessionClosed state. I have a precaution method, which checks for this right before opening a new session and clears the old session like this:
FBSession* session = [FBSession activeSession];
[session closeAndClearTokenInformation];
[session close];
[FBSession setActiveSession:nil];
Then I open a new session with the following method
[FBSession openActiveSessionWithPublishPermissions:#[#"publish_actions", #"user_likes"]
defaultAudience:FBSessionDefaultAudienceFriends
allowLoginUI:YES
completionHandler: ... ]
and have a crash.
Could anyone tell how to fix this problem?
Thanks.
LATE UPDATE.
It turned out that I deallocated some NSString object in my code twice. So the trouble is not relative to Facebook iOS client library.
Be safe around MRR, guys.
I would suggest check once with Instruments Tool, you will have a clear picture why and where exactly it is crashing.

Xcode lldb error - unsure where to start

I've been working on a small app, actually in final staging of polish and debug.
I made few small changes to NSUserDefaults storage, which were very minor changes.
However, every time I try to run the app on iPod I get a weird LLDB error, without any further info, like which file, library etc... I set up breakpoints in application:didFinishLoadingWithOptions, but the error is before that?? The app is stuck on splashscreen.
Dump if it is on any help...
Thread 1: EXC_BAD_ACCESS (code=2, address=0x2fd77d4c)
0x2fd77d4c: svchs #14122336
0x2fd77d50: svchs #14122908
0x2fd77d54: svchs #14122923
0x2fd77d58: svchs #14122954
0x2fd77d5c: andeq r0, r0, r0
0x2fd77d60: rsbvc r7, r1, #49283072
0x2fd77d64: rsbvs r6, pc, #3008
0x2fd77d68: svchs #6646889
Does an empty project works with your iPOD? If the answer is yes, comment out all codes you wrote then uncomment it part by part to find which part caused this issue, vise versa.
It's always effective to slice suspect codes to pieces when you can't locate the issue.

Debugging free() with Xcode

I'm getting the following error while trying to run an iOS app I'm developing:
appname(6097,0x3e835d98) malloc: *** error for object 0x20104600: pointer being freed was not allocated
*** set a breakpoint in malloc_error_break to debug
How can I find out which call to free() generated this error? If I add a breakpoint for malloc_error_break, the whole stack trace I get is a call to "malloc_error_break" which looks like this:
libsystem_c.dylib`malloc_error_break:
0x32f20fa8: push {r7, lr} < Thread 1: breakpoint 1.1
0x32f20faa: mov r7, sp
0x32f20fac: nop
0x32f20fae: nop
0x32f20fb0: pop {r7, pc}
0x32f20fb2: nop
If I don't add a breakpoint for malloc_error_break, I get a similarly useless stack trace, but this time with just a __pthread_kill and an assembler instruction.
Is there anything else I can do to get a better idea about the code that generated this error?
I have just created a new project called "Test" with the following main method:
void* data = malloc(100);
free(data);
free(data);
Then I open "Product->Edit Scheme", click on the "Test.app" tab and click on "Diagnostics". Then I select "Enable Guard Malloc".
Now, if I run the application, I get a break on the second free.

Resources