InMobi / sdk-sample-code-ios

This repository contains InMobi iOS SDK sample code for different ad-formats, which publishers can use to incorporate in their apps
MIT License
18 stars 12 forks source link

App crashes when `dataWithJSONObject` from `[IMAdStore getAdFromNetwork:]` #10

Open levantAJ opened 6 years ago

levantAJ commented 6 years ago

Hi, We are getting a lot crashes from inmobi ios sdk with following stacktrace, can you please guide whats wrong, please ?

Fatal Exception: NSInvalidArgumentException
*** +[NSJSONSerialization dataWithJSONObject:options:error:]: value parameter is nil
Fatal Exception: NSInvalidArgumentException
0  CoreFoundation                 0x1822dadb0 __exceptionPreprocess
1  libobjc.A.dylib                0x18193ff80 objc_exception_throw
2  CoreFoundation                 0x1822dacf8 -[NSException initWithCoder:]
3  Foundation                     0x182d27e74 +[NSJSONSerialization dataWithJSONObject:options:error:]
4  MyAppName                            0x101627774 -[IMAdStore createAdNetworkRequest:]
5  MyAppName                             0x101626fa4 __30-[IMAdStore getAdFromNetwork:]_block_invoke
6  libdispatch.dylib              0x181d254bc _dispatch_call_block_and_release
7  libdispatch.dylib              0x181d2547c _dispatch_client_callout
8  libdispatch.dylib              0x181d2ab84 _dispatch_main_queue_callback_4CF
9  CoreFoundation                 0x182290d50 __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__
10 CoreFoundation                 0x18228ebb8 __CFRunLoopRun
11 CoreFoundation                 0x1821b8c50 CFRunLoopRunSpecific
12 GraphicsServices               0x183aa0088 GSEventRunModal
13 UIKit                          0x1874a2088 UIApplicationMain
14 MyAppName                            0x100066dd8 main (main.m:15)

Thanks.

kvaddamani commented 6 years ago

Hi @levantAJ

We have fixed it in our next SDK. We will keep you posted on this.

Thank you