I have encountered a strange crash, which seems to come from inside of MOE, but I am not sure. It is easily reproducible inside my project, but it does not seem to have a clear cause. When I click the Back button of my navigation controller under certain conditions, the app crashes with this in the output:
2017-08-30 21:52:45.677 AppNameRedacted[11817:5932886] -[java.lang.Long intValue]: unrecognized selector sent to instance 0x14606d110
2017-08-30 21:52:45.685 AppNameRedacted[11817:5932886] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[java.lang.Long intValue]: unrecognized selector sent to instance 0x14606d110'
*** First throw call stack:
(0x1818aadb0 0x180f0ff80 0x1818b1c4c 0x1818aebec 0x1817acc5c 0x186986f4c 0x186988394 0x186a235dc 0x186a968f0 0x186a96678 0x1843c6228 0x1843b08ac 0x1844c8360 0x1843afa88 0x1843917a8 0x184391494 0x184390ab8 0x184390818 0x184389ddc 0x181860728 0x18185e4cc 0x18185e8fc 0x181788c50 0x183070088 0x186a76088 0x104530044 0x1045446e0 0x104528af8 0x1045289a0 0x104529a2c 0x104544e64 0x1045301b4 0x107d824f4 0x1042473f0 0x10428df30 0x10428dc84 0x104338a08 0x104025f94 0x1043d8e10 0x10402424c 0x10005fbe8 0x1813268b8)
libc++abi.dylib: terminating with uncaught exception of type NSException
There is no meaningful stack trace and I have been unable to decipher what the addresses in “First throw call stack” mean. Setting breakpoint in Xcode on NSObject’s “doesNotRecognizeSelector” (which gets triggered during this crash) revealed, that the stack trace just leads to “UIKit.UIApplicationMain()” invocation in my “main()”, which is probably wrong.
I have not found any place in my code, which could trigger this error. The method in question (Long.intValue()) is there, loaded and works, I have added it explicitly to rule out that it is removed from the binary, as it happens sometimes with proguard (I am not even sure if MOE uses proguard).
So the question is:
Has anybody encountered something like this before? I have exhausted my options - what do I do now? Are there any MOE debug flags that enable verbose logging or something that could help me to debug this?