question

momoftwo avatar image
momoftwo asked

Amazon Mobile Ads iOS SDK - Threading Issues Fixed?

I noticed several months ago that the Amazon Mobile Ads iOS SDK was causing my iOS app to lock up. The errors had to do with the API accessing data on the wrong thread. I was in a rush to get the app published, and I knew I couldn't include the Amazon Mobile Ads SDK if it was going to cause the app to hang, so I removed it. I cannot recreate the errors to post them here, but I noticed that the SDK has not been updated since the time I was getting these errors. My question for Amazon is: did you happen to have threading errors reported by anyone else in the last couple of months, and have they been fixed? If not in the SDK, then maybe on your server's end?

mobile adssdkiosmobile apis and services
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Ross@Amazon avatar image
Ross@Amazon answered

Hi momoftwo,

I do not recall any other posts inquiring about mobile ads threading. Without any logs to refer to we won't be able to debug this issue.

2 comments
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Have you seen the log I posted?

0 Likes 0 ·

Ross, is there a way to contact you directly? I am very concerned about this error and it would help to know if it is on Amazon's radar.

0 Likes 0 ·
momoftwo avatar image
momoftwo answered

Where can I send a log?

10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

momoftwo avatar image
momoftwo answered

2018-02-15 13:26:51.857496-0500 MyApp[52543:13271557] AmazonAd [Info]: Impression pixel was successfully fired. https://aax-us-east.amazon-adsystem.com/e/msdk/imp?b=QhXee2XyVSJcabgJpIpo4B4AAAFhmrgMXQEAAA-gAo46cNg

2018-02-15 13:26:51.857850-0500 MyApp[52543:13271557] AmazonAd [Debug]: <AMAdManager: 0x6040007b7920> dealloc

2018-02-15 13:26:51.858705-0500 MyApp[52543:13271557] AmazonAd [Info]: Ad view (0x6040007b7920) is no longer ignoring autorefresh.

2018-02-15 13:26:51.859751-0500 MyApp[52543:13271557] AmazonAd [Debug]: <AMMPMraidAdapter: 0x60c000228d20> dealloc

=================================================================

Main Thread Checker: UI API called on a background thread: -[UIControl removeTarget:action:forControlEvents:]

PID: 52543, TID: 13271557, Thread name: (none), Queue name: NSOperationQueue 0x600000230a60 (QOS: UNSPECIFIED), QoS: 0

Backtrace:

4 MyApp 0x0000000107a4e357 -[AMAMraidBaseAdView setDelegate:] + 87

5 MyApp 0x0000000107a41e38 -[AMMPMraidAdapter dealloc] + 89

6 libobjc.A.dylib 0x0000000111496a2e _ZN11objc_object17sidetable_releaseEb + 202

7 MyApp 0x0000000107a355f5 -[AMAdManager .cxx_destruct] + 196

8 libobjc.A.dylib 0x0000000111480912 _ZL27object_cxxDestructFromClassP11objc_objectP10objc_class + 127

9 libobjc.A.dylib 0x000000011148c1a4 objc_destructInstance + 124

10 libobjc.A.dylib 0x000000011148c1db object_dispose + 22

11 MyApp 0x0000000107a31452 -[AMAdManager dealloc] + 245

12 libobjc.A.dylib 0x0000000111496a2e _ZN11objc_object17sidetable_releaseEb + 202

13 libsystem_blocks.dylib 0x0000000112a5299d _Block_release + 111

14 libsystem_blocks.dylib 0x0000000112a5299d _Block_release + 111

15 CFNetwork 0x000000010998c6e5 __destroy_helper_block_.237 + 23

16 libsystem_blocks.dylib 0x0000000112a5299d _Block_release + 111

17 libsystem_blocks.dylib 0x0000000112a5299d _Block_release + 111

18 Foundation 0x000000010bc879f7 -[NSBlockOperation dealloc] + 57

19 libobjc.A.dylib 0x0000000111496a2e _ZN11objc_object17sidetable_releaseEb + 202

20 Foundation 0x000000010bc816f8 __NSOQSchedule_f + 754

21 libdispatch.dylib 0x000000011296533d _dispatch_client_callout + 8

22 libdispatch.dylib 0x000000011296b754 _dispatch_continuation_pop + 967

23 libdispatch.dylib 0x0000000112969b85 _dispatch_async_redirect_invoke + 780

24 libdispatch.dylib 0x0000000112971102 _dispatch_root_queue_drain + 772

25 libdispatch.dylib 0x0000000112970da0 _dispatch_worker_thread3 + 132

26 libsystem_pthread.dylib 0x0000000112e2c5a2 _pthread_wqthread + 1299

27 libsystem_pthread.dylib 0x0000000112e2c07d start_wqthread + 13

2018-02-15 13:26:51.893034-0500 MyApp[52543:13271557] [reports] Main Thread Checker: UI API called on a background thread: -[UIControl removeTarget:action:forControlEvents:]

PID: 52543, TID: 13271557, Thread name: (none), Queue name: NSOperationQueue 0x600000230a60 (QOS: UNSPECIFIED), QoS: 0

Backtrace:

4 MyApp 0x0000000107a4e357 -[AMAMraidBaseAdView setDelegate:] + 87

5 MyApp 0x0000000107a41e38 -[AMMPMraidAdapter dealloc] + 89

6 libobjc.A.dylib 0x0000000111496a2e _ZN11objc_object17sidetable_releaseEb + 202

7 MyApp 0x0000000107a355f5 -[AMAdManager .cxx_destruct] + 196

8 libobjc.A.dylib 0x0000000111480912 _ZL27object_cxxDestructFromClassP11objc_objectP10objc_class + 127

9 libobjc.A.dylib 0x000000011148c1a4 objc_destructInstance + 124

10 libobjc.A.dylib 0x000000011148c1db object_dispose + 22

11 MyApp 0x0000000107a31452 -[AMAdManager dealloc] + 245

12 libobjc.A.dylib 0x0000000111496a2e _ZN11objc_object17sidetable_releaseEb + 202

13 libsystem_blocks.dylib 0x0000000112a5299d _Block_release + 111

14 libsystem_blocks.dylib 0x0000000112a5299d _Block_release + 111

15 CFNetwork 0x000000010998c6e5 __destroy_helper_block_.237 + 23

16 libsystem_blocks.dylib 0x0000000112a5299d _Block_release + 111

17 libsystem_blocks.dylib 0x0000000112a5299d _Block_release + 111

18 Foundation 0x000000010bc879f7 -[NSBlockOperation dealloc] + 57

19 libobjc.A.dylib 0x0000000111496a2e _ZN11objc_object17sidetable_releaseEb + 202

20 Foundation 0x000000010bc816f8 __NSOQSchedule_f + 754

21 libdispatch.dylib 0x000000011296533d _dispatch_client_callout + 8

22 libdispatch.dylib 0x000000011296b754 _dispatch_continuation_pop + 967

23 libdispatch.dylib 0x0000000112969b85 _dispatch_async_redirect_invoke + 780

24 libdispatch.dylib 0x0000000112971102 _dispatch_root_queue_drain + 772

25 libdispatch.dylib 0x0000000112970da0 _dispatch_worker_thread3 + 132

26 libsystem_pthread.dylib 0x0000000112e2c5a2 _pthread_wqthread + 1299

27 libsystem_pthread.dylib 0x0000000112e2c07d start_wqthread + 13

=================================================================

Main Thread Checker: UI API called on a background thread: -[UIControl addTarget:action:forControlEvents:]

PID: 52543, TID: 13271557, Thread name: (none), Queue name: NSOperationQueue 0x600000230a60 (QOS: UNSPECIFIED), QoS: 0

Backtrace:

4 MyApp 0x0000000107a4e3c7 -[AMAMraidBaseAdView setDelegate:] + 199

5 MyApp 0x0000000107a41e38 -[AMMPMraidAdapter dealloc] + 89

6 libobjc.A.dylib 0x0000000111496a2e _ZN11objc_object17sidetable_releaseEb + 202

7 MyApp 0x0000000107a355f5 -[AMAdManager .cxx_destruct] + 196

8 libobjc.A.dylib 0x0000000111480912 _ZL27object_cxxDestructFromClassP11objc_objectP10objc_class + 127

9 libobjc.A.dylib 0x000000011148c1a4 objc_destructInstance + 124

10 libobjc.A.dylib 0x000000011148c1db object_dispose + 22

11 MyApp 0x0000000107a31452 -[AMAdManager dealloc] + 245

12 libobjc.A.dylib 0x0000000111496a2e _ZN11objc_object17sidetable_releaseEb + 202

13 libsystem_blocks.dylib 0x0000000112a5299d _Block_release + 111

14 libsystem_blocks.dylib 0x0000000112a5299d _Block_release + 111

15 CFNetwork 0x000000010998c6e5 __destroy_helper_block_.237 + 23

16 libsystem_blocks.dylib 0x0000000112a5299d _Block_release + 111

17 libsystem_blocks.dylib 0x0000000112a5299d _Block_release + 111

18 Foundation 0x000000010bc879f7 -[NSBlockOperation dealloc] + 57

19 libobjc.A.dylib 0x0000000111496a2e _ZN11objc_object17sidetable_releaseEb + 202

20 Foundation 0x000000010bc816f8 __NSOQSchedule_f + 754

21 libdispatch.dylib 0x000000011296533d _dispatch_client_callout + 8

22 libdispatch.dylib 0x000000011296b754 _dispatch_continuation_pop + 967

23 libdispatch.dylib 0x0000000112969b85 _dispatch_async_redirect_invoke + 780

24 libdispatch.dylib 0x0000000112971102 _dispatch_root_queue_drain + 772

25 libdispatch.dylib 0x0000000112970da0 _dispatch_worker_thread3 + 132

26 libsystem_pthread.dylib 0x0000000112e2c5a2 _pthread_wqthread + 1299

27 libsystem_pthread.dylib 0x0000000112e2c07d start_wqthread + 13

2018-02-15 13:26:51.933665-0500 MyApp[52543:13271557] [reports] Main Thread Checker: UI API called on a background thread: -[UIControl addTarget:action:forControlEvents:]

PID: 52543, TID: 13271557, Thread name: (none), Queue name: NSOperationQueue 0x600000230a60 (QOS: UNSPECIFIED), QoS: 0

Backtrace:

4 MyApp 0x0000000107a4e3c7 -[AMAMraidBaseAdView setDelegate:] + 199

5 MyApp 0x0000000107a41e38 -[AMMPMraidAdapter dealloc] + 89

6 libobjc.A.dylib 0x0000000111496a2e _ZN11objc_object17sidetable_releaseEb + 202

7 MyApp 0x0000000107a355f5 -[AMAdManager .cxx_destruct] + 196

8 libobjc.A.dylib 0x0000000111480912 _ZL27object_cxxDestructFromClassP11objc_objectP10objc_class + 127

9 libobjc.A.dylib 0x000000011148c1a4 objc_destructInstance + 124

10 libobjc.A.dylib 0x000000011148c1db object_dispose + 22

11 MyApp 0x0000000107a31452 -[AMAdManager dealloc] + 245

12 libobjc.A.dylib 0x0000000111496a2e _ZN11objc_object17sidetable_releaseEb + 202

13 libsystem_blocks.dylib 0x0000000112a5299d _Block_release + 111

14 libsystem_blocks.dylib 0x0000000112a5299d _Block_release + 111

15 CFNetwork 0x000000010998c6e5 __destroy_helper_block_.237 + 23

16 libsystem_blocks.dylib 0x0000000112a5299d _Block_release + 111

17 libsystem_blocks.dylib 0x0000000112a5299d _Block_release + 111

18 Foundation 0x000000010bc879f7 -[NSBlockOperation dealloc] + 57

19 libobjc.A.dylib 0x0000000111496a2e _ZN11objc_object17sidetable_releaseEb + 202

20 Foundation 0x000000010bc816f8 __NSOQSchedule_f + 754

21 libdispatch.dylib 0x000000011296533d _dispatch_client_callout + 8

22 libdispatch.dylib 0x000000011296b754 _dispatch_continuation_pop + 967

23 libdispatch.dylib 0x0000000112969b85 _dispatch_async_redirect_invoke + 780

24 libdispatch.dylib 0x0000000112971102 _dispatch_root_queue_drain + 772

25 libdispatch.dylib 0x0000000112970da0 _dispatch_worker_thread3 + 132

26 libsystem_pthread.dylib 0x0000000112e2c5a2 _pthread_wqthread + 1299

27 libsystem_pthread.dylib 0x0000000112e2c07d start_wqthread + 13

2018-02-15 13:26:52.009960-0500 MyApp[52543:13271306] AmazonAd [Debug]: <AMMRAdView: 0x7faa884039d0; frame = (0 0; 320 50); opaque = NO; autoresize = LM+RM; layer = <CALayer: 0x60400022e2a0>> dealloc

2018-02-15 13:26:52.010150-0500 MyApp[52543:13271306] AmazonAd [Debug]: <AMMRAdView: 0x7faa884039d0; frame = (0 0; 320 50); opaque = NO; autoresize = LM+RM; layer = <CALayer: 0x60400022e2a0>> dealloc

2018-02-15 13:26:52.010994-0500 MyApp[52543:13271306] AmazonAd [Debug]: <AMMRAdViewDisplayController: 0x7faa8b022e00> dealloc

2018-02-15 13:27:19.854169-0500 MyApp[52543:13271306] AmazonAd [Info]: Ad view (0x6000003a0000) is no longer ignoring autorefresh.

2018-02-15 13:27:19.854456-0500 MyApp[52543:13271306] AmazonAd [Info]: Ad view (0x6000003a0000) is now ignoring autorefresh.

2018-02-15 13:27:19.854813-0500 MyApp[52543:13271306] AmazonAd [Debug]: METRIC Increment lac

2018-02-15 13:27:19.855066-0500 MyApp[52543:13271306] AmazonAd [Debug]: METRIC Increment b_adrc

2018-02-15 13:27:19.855300-0500 MyApp[52543:13271306] AmazonAd [Debug]: METRIC Start tl

2018-02-15 13:27:19.858740-0500 MyApp[52543:13271306] AmazonAd [Debug]: -[AMAdConfiguration bootstrapConfigurationOnSuccess:onError:fromIdentityModule:]: reusing existing config

2018-02-15 13:27:19.859337-0500 MyApp[52543:13271306] AmazonAd [Info]: Bootstrap device skipped : within frequency time interval

2018-02-15 13:27:19.861765-0500 MyApp[52543:13271306] AmazonAd [Debug]: -[AMAdConfiguration bootstrapConfigurationOnSuccess:onError:fromIdentityModule:]: reusing existing config

2018-02-15 13:27:19.862194-0500 MyApp[52543:13271306] AmazonAd [Debug]: No events to register. Could not register events

2018-02-15 13:27:19.863431-0500 MyApp[52543:13271306] AmazonAd [Debug]: Cached IDFA: F151543A-0E8A-4671-8B6E-46E8448E9FEB Current IDFA: F151543A-0E8A-4671-8B6E-46E8448E9FEB

2018-02-15 13:27:19.863607-0500 MyApp[52543:13271306] AmazonAd [Debug]: Test Mode Enabled.

-[BannerViewManager viewControllerForPresentingModalView] - ENTERING

2018-02-15 13:27:19.864017-0500 MyApp[52543:13271306] Could not successfully update network info during initialization.

2018-02-15 13:27:19.864647-0500 MyApp[52543:13271306] AmazonAd [Debug]: Trying to get Json object from an object that is not a string

2018-02-15 13:27:19.864807-0500 MyApp[52543:13271306] AmazonAd [Debug]: Trying to get Json object from an object that is not a string

2018-02-15 13:27:19.865135-0500 MyApp[52543:13271306] AmazonAd [Debug]: Trying to get Json object from an object that is not a string

2018-02-15 13:27:19.865372-0500 MyApp[52543:13271306] AmazonAd [Debug]: Trying to get Json object from an object that is not a string

2018-02-15 13:27:19.865672-0500 MyApp[52543:13271306] AmazonAd [Debug]: Trying to get Json object from an object that is not a string

2018-02-15 13:27:19.866006-0500 MyApp[52543:13271306] AmazonAd [Debug]: METRIC Start al

2018-02-15 13:27:19.866237-0500 MyApp[52543:13271306] AmazonAd [Debug]: Ad loadStatus set to Loading.

2018-02-15 13:27:19.866581-0500 MyApp[52543:13271306] AmazonAd [Info]: Ad manager (0x6000003a0000) fired initial ad request.

Ad Request URL https://aax-us-east.amazon-adsystem.com/e/msdk/ads

Http headers {"User-Agent":"Mozilla\/5.0 (iPhone; CPU iPhone OS 11_2 like Mac OS X) AppleWebKit\/604.4.7 (KHTML, like Gecko) Mobile\/15C107 AmazonAdSDK-iOS\/2.2.15.1","Content-Type":"application\/json; charset=UTF-8","Accept":"application\/json"}

Http body{"isTest":"true","ats":"false","dinfo":{"make":"Apple","os":"iOS","country":"US","connectionType":"Wifi","osVersion":"11.2","model":"x86_64","language":"en","orientation":"portrait","screenSize":"640x1136","scalingFactor":"2.0"},"ua":"Mozilla\/5.0 (iPhone; CPU iPhone OS 11_2 like Mac OS X) AppleWebKit\/604.4.7 (KHTML, like Gecko) Mobile\/15C107 AmazonAdSDK-iOS\/2.2.15.1","slots":[{"slot":"portrait","mxsz":"640x100","slotId":1,"sz":"auto","video":{"minAdDuration":0,"maxAdDuration":30000},"supportedMediaTypes":["DISPLAY","VIDEO"]}],"appId":"00975c01cb9145e2b89cf822fd08f51f","ad-id":"A60N6BjNmk4Cg4zzGz-l7Hw","adsdk":"amznAdSD

2018-02-15 13:27:20.340545-0500 MyApp[52543:13271306] AmazonAd [Info]: Ad view (0x6000003a0000) received valid response from AAX server.

2018-02-15 13:27:20.340914-0500 MyApp[52543:13271306] AmazonAd [Debug]: METRIC Stop al

2018-02-15 13:27:20.341507-0500 MyApp[52543:13271306] AmazonAd [Info]: Ad manager (0x6000003a0000) received ad payload data string {"ads":[{"cacheRank":1,"cacheTTL":300,"impPixelURL":"https://aax-us-east.amazon-adsystem.com/e/msdk/imp?b=QpNiSZSILl3RkE3Er_6BvrAAAAFhmriHXAEAAA-gAg0_Zhc","size":"320x50","slotCpms":[],"instrPixelURL":"https://aax-us-east.amazon-adsystem.com/x/px/QpNiSZSILl3RkE3Er_6BvrAAAAFhmriHXAEAAA-gAg0_Zhc/","html":"\r\n<head><script src=\"amazon.js\"><\/script><script src=\"mraid.js\"><\/script><\/head><head><style>.ac{display:block;position:absolute;overflow:hidden;width:18px;height:14px;z-index:9;top:0;right:0;background:url(https://images-na.ssl-images-amazon.com/images/G/01/da/adchoices/ac-topright-sprite.png)}#vpc-logo{padding:0;position:absolute;background-repeat:no-repeat;background-position:50% 100%;height:15px;width:100%;bottom:16px;left:0;height:18px;width:17px}.hide{display:none!important}html,body{height:50px}#mobile-ads-ad{height:100%;overflow:hidden}#mobile-ads-link{position:relative;overflow:hidden}#mobile-ad-image{width:100%;hei

2018-02-15 13:27:20.342739-0500 MyApp[52543:13271306] AmazonAd [Info]: MobileAdsiOSSDK_:ATSDisabled_LoadAd_amznAdSDK-ios-2.2.15.1 metric fired: https://fls-na.amazon.com/1/action-impressions/1/OE/mobile-ads-sas/action/MobileAdsiOSSDK_:ATSDisabled_LoadAd_amznAdSDK-ios-2.2.15.1?marketplaceId=540412040&requestId=540412040&session=540412040

2018-02-15 13:27:20.343199-0500 MyApp[52543:13271306] AmazonAd [Debug]: METRIC Start mal

-[BannerViewManager viewControllerForPresentingModalView] - ENTERING

2018-02-15 13:27:20.365711-0500 MyApp[52543:13271306] AmazonAd [Debug]: Fragment detected: converting to full payload.

2018-02-15 13:27:20.366014-0500 MyApp[52543:13271306] AmazonAd [Debug]: Ad view (0x6000003a0000) loaded HTML content:

<head><script src="amazon.js"></script><script src="mraid.js"></script></head><head><style>.ac{display:block;position:absolute;overflow:hidden;width:18px;height:14px;z-index:9;top:0;right:0;background:url(https://images-na.ssl-images-amazon.com/images/G/01/da/adchoices/ac-topright-sprite.png)}#vpc-logo{padding:0;position:absolute;background-repeat:no-repeat;background-position:50% 100%;height:15px;width:100%;bottom:16px;left:0;height:18px;width:17px}.hide{display:none!important}html,body{height:50px}#mobile-ads-ad{height:100%;overflow:hidden}#mobile-ads-link{position:relative;overflow:hidden}#mobile-ad-image{width:100%;height:auto}</style></head><body style="margin:0px;padding:0px;text-align:center;overflow:hidden;"><div id="mobile-ads-ad"><a id="mobile-ads-link"><img id="mobile-ad-image"></a></div><script id="iframe_script">document.ad={aid:"4758883110801",cid:"5276225358998",w:320,h:50,template:"Image - mobile AAP-1.278"},window.aanResponse=

2018-02-15 13:27:20.382246-0500 MyApp[52543:13271306] AmazonAd [Info]: Ad started loading in the webview

2018-02-15 13:27:20.401947-0500 MyApp[52543:13271502] NSURLConnection finished with error - code -1002

2018-02-15 13:27:20.408973-0500 MyApp[52543:13271502] NSURLConnection finished with error - code -1002

2018-02-15 13:27:20.412729-0500 MyApp[52543:13271306] AmazonAd [Debug]: METRIC Stop mal

2018-02-15 13:27:20.413000-0500 MyApp[52543:13271306] AmazonAd [Debug]: Ad Loaded.

2018-02-15 13:27:20.413130-0500 MyApp[52543:13271306] AmazonAd [Debug]: METRIC Stop tl

2018-02-15 13:27:20.413315-0500 MyApp[52543:13271306] AmazonAd [Debug]: METRIC Submit for object 0x6000003a0000

2018-02-15 13:27:20.413437-0500 MyApp[52543:13271306] AmazonAd [Debug]: GET https://aax-us-east.amazon-adsystem.com/x/px/QpNiSZSILl3RkE3Er_6BvrAAAAFhmriHXAEAAA-gAg0_Zhc/%7B%22b_adrc%22%3A1%2C%22lac%22%3A1%2C%22c%22%3A%22msdki%22%2C%22mal%22%3A70%2C%22al%22%3A475%2C%22tl%22%3A558%2C%22rl%22%3A70%7D

10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

momoftwo avatar image
momoftwo answered

Ross@Amazon, any thoughts about this log, or any questions?

10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

momoftwo avatar image
momoftwo answered

Does anyone have any idea on how to get Amazon's attention on this? It is an error that has been there for months and is apparently not on their radar at all. iOS takes threading issues very seriously and this API as-is can hang or crash an app. Ross@Amazon, if you can't help, is there a way you could forward this information to someone who can?

10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

newuser-f3e6c6a5-0541-4dcd-9afe-e128b72bf305 avatar image
newuser-f3e6c6a5-0541-4dcd-9afe-e128b72bf305 answered

Sample project has same issue.

Probably It means amazon guy doesnt test this SDK.

And no iOS Developper use this ultra buggy SDK in production environment.

1 comment
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

I think this SDK is definitely worth using, but I am hoping that this will be fixed.

0 Likes 0 ·
momoftwo avatar image
momoftwo answered

Ross@Amazon? Anyone there?

10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.