0

I keep getting this issue in my Fabric crash log:

Fatal Exception: NSInvalidArgumentException
-[__NSCFNumber length]: unrecognized selector sent to instance 0xb0000000000a8d23
-[LLNetworkHandlerBase createRequestWithURL:installId:libraryVersion:customerId:]

com.apple.main-thread
APPNAME     -[LLManagerBase syncExecuteBlock:]
APPNAME     -[LLAnalyticsManager applicationKey]
APPNAME     +[Localytics customerIdInMemory]
APPNAME     +[Localytics upload]

Crashed: com.localytics.LLAnalyticsManager_queue
-[LLNetworkHandlerBase createRequestWithURL:installId:libraryVersion:customerId:]

... but I am not able to replicate the bug. It seems like the issue is coming from the Localytics SDK, but I am not able to find similar issue described anywhere.

The issue affects maybe more than half of the users... and seems to only happen once per user (the first time that they launch the app and register as far as I can tell).

The Localytics SDK in use is 3.1.1 ...

Has anyone else encountered a similar issue or know how to fix it?

  • Here is the full log: http://s9.postimg.org/b2g9ts90v/crash0.jpg http://s2.postimg.org/44epb2t15/crash1.jpg ... I am not calling the function from anywhere In my code, it is being executed from a Localytics class – Виктор Иванов May 26 '15 at 10:36

1 Answers1

2

You are passing customerId. as NSNumber This should be NSString

If you show the code, I can help you fixed that, but you didn't post a line.

Grzegorz Krukowski
  • 18,081
  • 5
  • 50
  • 71
  • Ah yeah... [Localytics setCustomerId:globals.uID]; I think this was causing the issue... Will it work if I make it: [Localytics setCustomerId:[NSString stringWithFormat:@"%@", globals.uID]]; – Виктор Иванов May 26 '15 at 10:40
  • Crash is saying that you somehow using NSNumber as NSString - from what you shown, that would be the only place, but since you don't show your own code, hard to help. And problem is definetely in your code :) – Grzegorz Krukowski May 26 '15 at 10:49
  • "[Localytics setCustomerId:globals.uID];" ... this is the only place in my code where the "customerID" variable is set or mentioned... so Im guessing this should be it. Although the globals.uID is surely an NSString – Виктор Иванов May 26 '15 at 10:55
  • How do you confirm that ? Can you breakpoint there, make "po [customerId class]" in console ? – Grzegorz Krukowski May 26 '15 at 10:57
  • I was able to reproduce the error by manually setting an NSNumber variable in the Localytics setCustomerId method. Just not sure why it crashed just sometimes... and never on any of my test devices.... or emulators. – Виктор Иванов May 26 '15 at 11:07
  • Where did you get the crash from then ? Maybe you are saving it to a file and during loading you do conversation – Grzegorz Krukowski May 26 '15 at 11:22
  • I didn't do anything... the Localytics SDK handled everything from that point on... since explicitly setting it to a string it looks good... Hope that was the whole issue – Виктор Иванов May 26 '15 at 12:09