Crash when loading image Firebase - ios

When loading the main view controller of my app it loads multiple images. Using the sd_setImage(with: reference) method. It has worked forever and now I am suddenly getting crashes with the exception
-[SDImageCache storeImage:forKey:]: unrecognized selector sent to instance 0x600000c60380
*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[SDImageCache storeImage:forKey:]: unrecognized selector sent to instance 0x600000c60380'
The stacktrace isn't showing a line in my code that's causing the problem. Is this an internal Firebase bug? How do I fix it?

Firebase calls continuous asynchronous calls to the observer. You should always check for nil or NSNull before attempting to present data from the database. You may have a higher resolution image that takes longer to load than it does your view to appear.

Related

Sending NS user authentication data with Xcode 8.3.3 and Swift 3 from mobile app to server issue

I'm new to authentication development and am stumped.
When I touch (click on simulator) Sign Up button in the app to submit my user name and password Xcode log shows the following error,
20 Selfie 0x0000000100479707 main + 55
21 libdyld.dylib 0x000000010393d65d start + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException
Further more, this appears when I scroll up, and seems the first signs of an issue
2017-07-13 18:27:42.367 Selfie[75333:3951236] *** Terminating app due
to uncaught exception 'NSInvalidArgumentException', reason: '-
[Selfie.ViewController signupBtnTapped:]: unrecognized selector sent
to instance 0x7fc042c11250'
The desired result is for the app to send the built request to my remote server held by AWS. Here's the pre-dated tutorial I'm using:
https://www.raywenderlich.com/85528/user-accounts-ios-ruby-rails-swift
Here is the repo for the app, in the specific view controller it seems the problem is in, and where I'm left off in the tutorials instruction (at the sign up btn):
https://github.com/tristanbnewman/rwenderlich-auth-selfie/blob/master/Selfie/ViewController.swift
I apologize ahead of time for any etiquettes I've missed in this post, if there's anything you all need to help me solving (likely something I've missed providing you) just let me know.
First of all i would suggest you to make breakpoints on each line of the signupBtnTapped function and see what's happening.
The "unrecognized selector sent to instance" is probably related to how you connect your #IBAction with a button event. Have you connected touchUpInside event with your function in the storyboard?
The first exception is a generic exception which doesn't give much information. Making breakpoints should help you with this.

Terminating app due to uncaught exception 'FirebaseShutdown', reason: 'Firebase error

Terminating app due to uncaught exception 'FirebaseShutdown', reason: 'Firebase error. Please ensure that you spelled the name of your Firebase correctly' in ios.
Can any one help me solve this issue?
Using this demo for real time message:
https://github.com/firebase/ios-swift-chat-example
Is there any demo for real time chat in iOS?
The error you're getting is actually from calling [Firebase initWithUrl:] with a URL that isn't backed by a valid Firebase.
This exception is thrown so that you as a developer know that the Firebase you're connecting to is invalid.
If you put in the right Firebase URL, you shouldn't be getting this error.
Could you explain the situation in which you might need to connect to a Firebase that may not be valid?
Note:- You will need to check your base URL for the Firebase, Because you have try to access data from the wrong URL

Flurry Crashing iOS When Resuming Background Thread [__NSCFNumber length]: unrecognized selector sent to instance 0xb000000000c58913

There are a lot of posts on this 'type' of error
[__NSCFNumber length]: unrecognized selector sent to instance 0xb000000000c58913
but none of it has bearing on my situation unfortunately.
The reason is our app is crashing on a background thread with the flurry SDK. I can't investigate the stack trace any deeper because I just get machine code.
I've tried commenting every line of code inside my flurry.m file but not of it encapsulates the error because this is happening inside the flurrySDK.
Its always crashing on thread 22 when I resume from background on the function
+[FlurryProtocolData limitStringLength:]
If you have any advice what so ever on how I look at this further I would love to hear it!
We were passing an ID as one of the session parameters to Flurry.
However it doesn't cause a crash until its loaded from a background thread oddly enough.r
Making sure the ID was a string before passing it fixed the issue.

iOS 7: UIWebView crashes because of range exception

I'm currently building an App that uses the krpano viewer, which is a Panorama Viewer built with JavaScript. I'm loading this Panorama viewer in a UIWebView with local images that are saved on the iPad.
But after using the Panorama viewer for a while, I get this error and the app crashes:
Terminating app due to uncaught exception 'NSRangeException', reason: '*** -[WebCoreSharedBufferData getBytes:range:]: range {0, 4000} exceeds data length 0'
*** First throw call stack:
(0x2e213f53 0x38a226af 0x2e213e95 0x2eb4dc31 0x2e16ca65 0x2ef4ce47 0x2ef4cd21 0x2ef68f03 0x2ef682db 0x2ef68029 0x2ef67e61 0x2ef67dcf 0x2ef6bd39 0x2ef6b813 0x2ef5471f 0x2e29b2ed 0x30635c6d 0x30635117 0x30621069 0x30620bad 0x3061d949 0x3061c051 0x38f0c297 0x38f0c09b 0x38f0cd15 0x38f0cf8d 0x39047dbf 0x39047c84)
libc++abi.dylib: terminating with uncaught exception of type NSException
Does anyone have an idea why this happens? When I load the online page in the UIWebView there is no problem.
Thanks for your help!
This is probably a memory related issue. When a web application allocates too much memory using Javascript, weird things will happen.
Your best bet is to observe memory warning notifications and try to influence the web app from the outside. Of course this depends on the specifics of the web app but you might want to try disabling userInteractionEnabled for a while to let the web view catch up with queued user input actions or, if the memory warning persists, try to reload the web view.
Unfortunately there are no easy solutions here.

NSInvalidArgument Exception - Random Objects Receiving didEnterBackground

Every time a user taps the home button while my app is active, I am getting the following exception. Slight caveat - The example exception below references NSCFString. However, the type of object that gets sent this message, and thus causes the exception is totally random. It could be an NSData or an OS_dispatch_queue_specific_queue.
[__NSCFString didEnterBackground:]: unrecognized selector sent to
instance 0x155344c0 * Terminating app due to uncaught exception
'NSInvalidArgumentException', reason: '-[__NSCFString
didEnterBackground:]: unrecognized selector sent to instance
0x155344c0
Happens every single time the app is resigned active, but the object receiving the message is never the same.
I assume this is some sort of memory issue but am having trouble tracking it down. Mostly because nothing in my code ever directly sends/receives this message, or is registered to receive the UIApplicationWillResignActiveNotification. Also, there is nothing in my appDelegate for the applicationDidEnterBackground:application method.
Has anyone ever seen this type of behavior? And if so, what is the best way to debug? Or maybe another way, what sorts of objects would be automatically sent the didEnterBackground message that I am clearly mismanaging?
It sounds like you have a zombie.
A zombie is an object that gets called after it is deallocated. Often, the memory address of the object is then used for another object, so the message goes to the wrong object.
Do you have code that registers one of your application objects for a "did enter background" notification (UIApplicationDidEnterBackgroundNotification) using the method addObserver:selector:name:object:? And does that notification specify a selector of "didEnterBackground:?"
My guess is that you're registering for UIApplicationDidEnterBackgroundNotification notifications, and then the notificationObserver you're specifying is being deallocated. That would cause the exact behavior you are describing.
BTW, you might want to run your app using the zombies instrument, or turn on the NSZombies environment variable to look for zombies. Then press the home button to cause the crash and see what Xcode/instruments tells you.

Resources