[TIMOB-17826] iOS: Disabling analytics in tiapp.xml leads to iads crash on device
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | High |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2014-11-27T10:12:00.000+0000 |
Affected Version/s | Release 3.4.0 |
Fix Version/s | Release 3.4.2, Release 3.5.0, Release 4.0.0 |
Components | iOS |
Labels | TCSupportTriage, analytics, device, iad, ios, module_analytics, qe-manualtest |
Reporter | Dan Tamas |
Assignee | Chee Kiat Ng |
Created | 2014-09-27T16:17:34.000+0000 |
Updated | 2014-11-27T10:12:00.000+0000 |
Description
If you disable the analytics in tiapp.xml and then try to use iAds it will crash with the following log:
[ERROR] The application has crashed with an uncaught exception 'NSInvalidArgumentException'.
[ERROR] Reason:
[ERROR] *** setObjectForKey: object cannot be nil (key: sid)
[ERROR] Stack trace:
[ERROR]
[ERROR] 0 CoreFoundation 0x240eae3f <redacted> + 126
[ERROR] 1 libobjc.A.dylib 0x31798c8b objc_exception_throw + 38
[ERROR] 2 CoreFoundation 0x24008ec3 <redacted> + 850
[ERROR] 3 Comnio 0x0022de8f Comnio + 1871503
[ERROR] 4 Comnio 0x0022febd Comnio + 1879741
[ERROR] 5 Foundation 0x24de4ae1 <redacted> + 8
[ERROR] 6 Foundation 0x24d4fb7d <redacted> + 148
[ERROR] 7 Foundation 0x24d42337 <redacted> + 774
[ERROR] 8 Foundation 0x24de744b <redacted> + 186
[ERROR] 9 libdispatch.dylib 0x31d00651 <redacted> + 952
[ERROR] 10 libdispatch.dylib 0x31cfb09d <redacted> + 84
[ERROR] 11 libdispatch.dylib 0x31d01ba1 <redacted> + 320
[ERROR] 12 libdispatch.dylib 0x31d02cd7 <redacted> + 94
[ERROR] 13 libsystem_pthread.dylib 0x31e59e31 _pthread_wqthread + 668
[ERROR] 14 libsystem_pthread.dylib 0x31e59b84 start_wqthread + 8
[ERROR] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** setObjectForKey: object cannot be nil (key: sid)'
[ERROR] *** First throw call stack:
[ERROR] (0x240eae3f 0x31798c8b 0x24008ec3 0x22de8f 0x22febd 0x24de4ae1 0x24d4fb7d 0x24d42337 0x24de744b 0x31d00651 0x31cfb09d 0x31d01ba1 0x31d02cd7 0x31e59e31 0x31e59b84)
^C
The only place where I see an object with a key "sid" is the Geolocation module
https://github.com/appcelerator/titanium_mobile/blob/ad9eea392dd7b0820c1b5f65c9147cf1ce4c8662/iphone/Classes/GeolocationModule.m#L525
that asks for a Ti.App.sessionId that seems to be set by the analytics.
Putting back analytics to true in tiapp.xml fixes the issue, however it is not ok.
How to reproduce:
1. Disable analytics in tiapp.xml
<analytics>false</analytics>
2. Add this is alloy.js (or anywhere)
iad = Titanium.UI.iOS.createAdView({
adSize: Titanium.UI.iOS.AD_SIZE_PORTRAIT
});
Attachments
File | Date | Size |
---|---|---|
monkey_console.txt | 2014-10-23T22:42:14.000+0000 | 1419 |
monkey_no_analytics.crash | 2014-10-23T22:42:14.000+0000 | 43942 |
That might even imply just geolocation module by itself only works with analyics enabled. Have you tested that? The
Ti.App.sessionId
is not set by analytics, but "just" an UUID set on boot: https://github.com/appcelerator/titanium_mobile/blob/ad9eea392dd7b0820c1b5f65c9147cf1ce4c8662/iphone/Classes/TiApp.m#L181Hi [~rborn], We haven't been able to reproduce your issue using the instructions above. Below is a small sample that we have used to test for the crash when
analytics
is false on device. Please run it and let us know ifreateAdView
orforwardGeocoder
cause the crash (If the issue was coming from geolocation then it should happen when callingforwardGeocoder
). If this sample doesn't work, please include a sample that we can use to reproduce the issue. Also, what devices is this happening on?Sorry for the late reply I'm using few modules
I will try to run your test app with and without the modules, and mine as well to see if there is any of the modules that does this.
Crittercism crash report (see symbolicated below)
Modules in use
Other
iAds is used in the app. System Version: 8.0.2 iOS sdk target was 7.xHad to use the patched libAPSAnalytics.a from TIMOB-17350 to get around the duplicate symbols error at the time.
Symbolicated report
Hey [~sfeather] - Any chance we could get some repro steps? Also, can you reproduce this issue without the other modules included in the project?
This is an app in the wild. Simply confirming the bug by Dan. I do not know what steps took place to cause it. I changed the comment to add the symbolicated report which indicates its in the APSanalytics.m
I tried to reproduce the bug in a new project, however I didn't manage to do it yet. I'll keep trying.
I just ran into the same problem with an existing App and luckily found this ticket. Enabling Analytics in tiapp.xml fixed the iAd-Crash. Also using SDK 3.4.0GA (not tried the patch from TIMOB-17350 since I am OK with the analytics for now), iOS 8.0.2 on an iPhone 6. I'm using other modules then the ones mentioned in the other comments: {quote}
bannerViewDidLoadAd
in which it should not go because analytics is disabled. Looking atmain.m
I can see thatTI_APPLICATION_ANALYTICS
is correctly set toNO
but for some reasons must evaluate differently in the iAd module.Thanks for the info [~favo]. Agreed, it looks like the crash is here: https://github.com/appcelerator/titanium_mobile/blob/master/iphone/Classes/TiUIiOSAdView.m#L81 But we have still not been able to reproduce the issue on this end. Any info that will help us reproduce the issue will be greatly appreciated.
I was able to reproduce this issue with SDK build 3.4.1.v20141022101712; looks like adView.show() is triggering the crash. *Steps to reproduce:* 1. Create a new Titanium classic app 2. In the tiapp.xml, look for *analytics* node and set to false 3. In the app.js, use the following code:
4. Install app to device *Actual:* After the app launches and a couple of seconds, the app will crash; see monkey_console.txt and monkey_no_analytics.crash. *Tested on:* Appcelerator Studio, build: 3.4.1.201410191611 SDK build: 3.4.1.v20141022101712 CLI: 3.4.1-dev Alloy: 1.5.1 Xcode: 6.1 Devices: iphone 5 (8.1)
Thanks [~wluu]. Problem found and fixed. PR here: https://github.com/appcelerator/titanium_mobile/pull/6267 3_4_X PR: https://github.com/appcelerator/titanium_mobile/pull/6268
The Apple iAds view is showed without crash when the Analytics is turned off in tiApp.xml. Hence closing the ticket. Tested with below Environment: 1. Mac OSX Yosemite 10.10 2. Appcelerator Studio, build: 3.4.1.201410281743 3. Titanium SDK, build: 3.5.0.v20141125154115 4. Titanium CLI, build: 3.4.1 5. Alloy: 1.5.1 6. Xcode 6.1 7. iOS SDK 8.1 8. iPhone 5s with iOS 8.1