App Crash only on App Review

I have a weird problem with my app. I needed to update the metadata on App Store connect and uploaded a new build to App Store. The only thing that was changed in code is two strings with version number. Everything else is exactly the same as a version that is live on the App Store (which works fine). I got a rejection with 2.1.0 Performance: App Completeness reason, turned out my app crashes on launch on reviewers device. I thought that this maybe a one time problem and tried to upload a new build with same results. Attached crash report.

Exception Type:  EXC_CRASH (SIGABRT)
Exception Codes: 0x0000000000000000, 0x0000000000000000
Exception Note:  EXC_CORPSE_NOTIFY
Triggered by Thread:  0

Application Specific Information:
abort() called


Last Exception Backtrace:
0   CoreFoundation                	       0x1aaf29288 __exceptionPreprocess + 220
1   libobjc.A.dylib               	       0x1c3c23744 objc_exception_throw + 60
2   Realm                         	       0x1031d3f90 RLMAccessorContext::createObject(objc_object*, realm::CreatePolicy, bool, realm::ObjKey) + 1776
3   Realm                         	       0x103212e1c RLMAddObjectToRealm + 264
4   RealmSwift                    	       0x1038784e0 Realm.add(_:update:) + 279776 (__hidden#4669_:438)
5   AppName             	       0x10275cf5c _hidden#5641_ + 282460 (__hidden#5706_:442)
6   AppName             	       0x1027dcd64 _hidden#12_ + 806244 (__hidden#1380_:0)
7   AppName             	       0x10275d1bc _hidden#296_ + 283068 (__hidden#1380_:0)
8   RealmSwift                    	       0x103877d78 Realm.write<a>(withoutNotifying:_:) + 277880 (__hidden#4669_:255)
9   AppName             	       0x10275d0f0 _hidden#5647_ + 282864 (__hidden#5706_:438)
10  AppName             	       0x1028374a0 _hidden#15379_ + 1176736 (__hidden#15477_:382)
11  AppName             	       0x102838824 _hidden#15383_ + 1181732 (__hidden#1380_:0)
12  UIKitCore                     	       0x1ad62f72c -[UIApplication _handleDelegateCallbacksWithOptions:isSuspended:restoreState:] + 340
13  UIKitCore                     	       0x1ad816564 -[UIApplication _callInitializationDelegatesWithActions:forCanvas:payload:fromOriginatingProcess:] + 3572
14  UIKitCore                     	       0x1ad7ff118 -[UIApplication _runWithMainScene:transitionContext:completion:] + 1180
15  UIKitCore                     	       0x1ad65cd34 -[_UISceneLifecycleMultiplexer completeApplicationLaunchWithFBSScene:transitionContext:] + 152
16  UIKitCore                     	       0x1ad4b73b4 _UIScenePerformActionsWithLifecycleActionMask + 104
17  UIKitCore                     	       0x1ad5e1d90 __101-[_UISceneLifecycleMultiplexer _evalTransitionToSettings:fromSettings:forceExit:withTransitionStore:]_block_invoke + 216
18  UIKitCore                     	       0x1ad701aa0 -[_UISceneLifecycleMultiplexer _performBlock:withApplicationOfDeactivationReasons:fromReasons:] + 248
19  UIKitCore                     	       0x1ad940764 -[_UISceneLifecycleMultiplexer _evalTransitionToSettings:fromSettings:forceExit:withTransitionStore:] + 772
20  UIKitCore                     	       0x1ad8cbd14 -[_UISceneLifecycleMultiplexer uiScene:transitionedFromState:withTransitionContext:] + 340
21  UIKitCore                     	       0x1ad4b81a0 __186-[_UIWindowSceneFBSSceneTransitionContextDrivenLifecycleSettingsDiffAction _performActionsForUIScene:withUpdatedFBSScene:settingsDiff:fromSettings:transitionContext:lifecycleActionType:]_block_invoke + 196
22  UIKitCore                     	       0x1ad5780d8 +[BSAnimationSettings(UIKit) tryAnimatingWithSettings:actions:completion:] + 892
23  UIKitCore                     	       0x1ad4ba0a4 _UISceneSettingsDiffActionPerformChangesWithTransitionContext + 276
24  UIKitCore                     	       0x1ad5a4244 -[_UIWindowSceneFBSSceneTransitionContextDrivenLifecycleSettingsDiffAction _performActionsForUIScene:withUpdatedFBSScene:settingsDiff:fromSettings:transitionContext:lifecycleActionType:] + 384
25  UIKitCore                     	       0x1ada28e60 __64-[UIScene scene:didUpdateWithDiff:transitionContext:completion:]_block_invoke.615 + 776
26  UIKitCore                     	       0x1ad4e8484 -[UIScene _emitSceneSettingsUpdateResponseForCompletion:afterSceneUpdateWork:] + 256
27  UIKitCore                     	       0x1ad52bcc4 -[UIScene scene:didUpdateWithDiff:transitionContext:completion:] + 288
28  UIKitCore                     	       0x1ad661b38 -[UIApplication workspace:didCreateScene:withTransitionContext:completion:] + 584
29  UIKitCore                     	       0x1ad5a2508 -[UIApplicationSceneClientAgent scene:didInitializeWithEvent:completion:] + 388
30  FrontBoardServices            	       0x1bd133294 -[FBSScene _callOutQueue_agent_didCreateWithTransitionContext:completion:] + 440
31  FrontBoardServices            	       0x1bd159090 __94-[FBSWorkspaceScenesClient createWithSceneID:groupID:parameters:transitionContext:completion:]_block_invoke.215 + 128
32  FrontBoardServices            	       0x1bd114308 -[FBSWorkspace _calloutQueue_executeCalloutFromSource:withBlock:] + 240
33  FrontBoardServices            	       0x1bd115958 __94-[FBSWorkspaceScenesClient createWithSceneID:groupID:parameters:transitionContext:completion:]_block_invoke + 372
34  libdispatch.dylib             	       0x1aab90a30 _dispatch_client_callout + 20
35  libdispatch.dylib             	       0x1aab944e0 _dispatch_block_invoke_direct + 264
36  FrontBoardServices            	       0x1bd115c70 __FBSSERIALQUEUE_IS_CALLING_OUT_TO_A_BLOCK__ + 48
37  FrontBoardServices            	       0x1bd115040 -[FBSSerialQueue _targetQueue_performNextIfPossible] + 220
38  FrontBoardServices            	       0x1bd119700 -[FBSSerialQueue _performNextFromRunLoopSource] + 28
39  CoreFoundation                	       0x1aaf4b414 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 28
40  CoreFoundation                	       0x1aaf5c1a0 __CFRunLoopDoSource0 + 208
41  CoreFoundation                	       0x1aae95694 __CFRunLoopDoSources0 + 268
42  CoreFoundation                	       0x1aae9b05c __CFRunLoopRun + 828
43  CoreFoundation                	       0x1aaeaebc8 CFRunLoopRunSpecific + 600
44  GraphicsServices              	       0x1c6fe2374 GSEventRunModal + 164
45  UIKitCore                     	       0x1ad81e648 -[UIApplication _run] + 1100
46  UIKitCore                     	       0x1ad59fd90 UIApplicationMain + 364
47  AppName             	       0x1027211c8 main + 37320 (__hidden#1378_:63)
48  dyld                          	       0x102ed5ce4 start + 520

Thread 0 name:   Dispatch queue: com.apple.main-thread
Thread 0 Crashed:
0   libsystem_kernel.dylib        	       0x1e2965b38 __pthread_kill + 8
1   libsystem_pthread.dylib       	       0x21c0963bc pthread_kill + 268
2   libsystem_c.dylib             	       0x1b602f524 abort + 168
3   libc++abi.dylib               	       0x1c3d2eb7c abort_message + 132
4   libc++abi.dylib               	       0x1c3d1e9c4 demangling_terminate_handler() + 336
5   libobjc.A.dylib               	       0x1c3c29c68 _objc_terminate() + 144
6   libc++abi.dylib               	       0x1c3d2df18 std::__terminate(void (*)()) + 20
7   libc++abi.dylib               	       0x1c3d2deb4 std::terminate() + 64
8   libdispatch.dylib             	       0x1aab90a44 _dispatch_client_callout + 40
9   libdispatch.dylib             	       0x1aab944e0 _dispatch_block_invoke_direct + 264
10  FrontBoardServices            	       0x1bd115c70 __FBSSERIALQUEUE_IS_CALLING_OUT_TO_A_BLOCK__ + 48
11  FrontBoardServices            	       0x1bd115040 -[FBSSerialQueue _targetQueue_performNextIfPossible] + 220
12  FrontBoardServices            	       0x1bd119700 -[FBSSerialQueue _performNextFromRunLoopSource] + 28
13  CoreFoundation                	       0x1aaf4b414 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 28
14  CoreFoundation                	       0x1aaf5c1a0 __CFRunLoopDoSource0 + 208
15  CoreFoundation                	       0x1aae95694 __CFRunLoopDoSources0 + 268
16  CoreFoundation                	       0x1aae9b05c __CFRunLoopRun + 828
17  CoreFoundation                	       0x1aaeaebc8 CFRunLoopRunSpecific + 600
18  GraphicsServices              	       0x1c6fe2374 GSEventRunModal + 164
19  UIKitCore                     	       0x1ad81e648 -[UIApplication _run] + 1100
20  UIKitCore                     	       0x1ad59fd90 UIApplicationMain + 364
21  AppName             	       0x1027211c8 main + 37320 (__hidden#1378_:63)
22  dyld                          	       0x102ed5ce4 start + 520

Thread 1:
0   libsystem_pthread.dylib       	       0x21c08fe54 start_wqthread + 0

Thread 2:
0   libsystem_pthread.dylib       	       0x21c08fe54 start_wqthread + 0

Thread 3:
0   libsystem_pthread.dylib       	       0x21c08fe54 start_wqthread + 0

Thread 4 name:  com.apple.uikit.eventfetch-thread
Thread 4:
0   libsystem_kernel.dylib        	       0x1e295f4a0 mach_msg_trap + 8
1   libsystem_kernel.dylib        	       0x1e295fae4 mach_msg + 76
2   CoreFoundation                	       0x1aae96d30 __CFRunLoopServiceMachPort + 372
3   CoreFoundation                	       0x1aae9b1bc __CFRunLoopRun + 1180
4   CoreFoundation                	       0x1aaeaebc8 CFRunLoopRunSpecific + 600
5   Foundation                    	       0x1ac69d464 -[NSRunLoop(NSRunLoop) runMode:beforeDate:] + 236
6   Foundation                    	       0x1ac6dee2c -[NSRunLoop(NSRunLoop) runUntilDate:] + 92
7   UIKitCore                     	       0x1ad798770 -[UIEventFetcher threadMain] + 524
8   Foundation                    	       0x1ac6ed43c __NSThread__start__ + 808
9   libsystem_pthread.dylib       	       0x21c0909ac _pthread_start + 148
10  libsystem_pthread.dylib       	       0x21c08fe68 thread_start + 8

Thread 5:
0   libsystem_pthread.dylib       	       0x21c08fe54 start_wqthread + 0

Thread 6 name:   Dispatch queue: com.apple.UIKit.KeyboardManagement
Thread 6:
0   libsystem_kernel.dylib        	       0x1e2960138 __ulock_wait + 8
1   libdispatch.dylib             	       0x1aab91420 _dlock_wait + 56
2   libdispatch.dylib             	       0x1aab911d4 _dispatch_thread_event_wait_slow + 56
3   libdispatch.dylib             	       0x1aab9ff70 __DISPATCH_WAIT_FOR_QUEUE__ + 356
4   libdispatch.dylib             	       0x1aab9fb28 _dispatch_sync_f_slow + 144
5   UIKitCore                     	       0x1ad6785ac __37-[_UIRemoteKeyboards startConnection]_block_invoke_3 + 136
6   CoreFoundation                	       0x1aaeb1b24 __invoking___ + 148
7   CoreFoundation                	       0x1aaecf610 -[NSInvocation invoke] + 468
8   Foundation                    	       0x1ac6b9938 __NSXPCCONNECTION_IS_CALLING_OUT_TO_REPLY_BLOCK__ + 24
9   Foundation                    	       0x1ac6daf74 -[NSXPCConnection _decodeAndInvokeReplyBlockWithEvent:sequence:replyInfo:] + 572
10  Foundation                    	       0x1ac6b5480 __88-[NSXPCConnection _sendInvocation:orArguments:count:methodSignature:selector:withProxy:]_block_invoke_3 + 212
11  libxpc.dylib                  	       0x21c0c56ac _xpc_connection_reply_callout + 124
12  libxpc.dylib                  	       0x21c0b8bcc _xpc_connection_call_reply_async + 88
13  libdispatch.dylib             	       0x1aab90ab0 _dispatch_client_callout3 + 20
14  libdispatch.dylib             	       0x1aabae214 _dispatch_mach_msg_async_reply_invoke + 340
15  libdispatch.dylib             	       0x1aab98000 _dispatch_lane_serial_drain + 376
16  libdispatch.dylib             	       0x1aab98cb4 _dispatch_lane_invoke + 444
17  libdispatch.dylib             	       0x1aaba3500 _dispatch_workloop_worker_thread + 648
18  libsystem_pthread.dylib       	       0x21c0900bc _pthread_wqthread + 288
19  libsystem_pthread.dylib       	       0x21c08fe5c start_wqthread + 8

Thread 7 name:  AVAudioSession Notify Thread
Thread 7:
0   libsystem_kernel.dylib        	       0x1e295f4a0 mach_msg_trap + 8
1   libsystem_kernel.dylib        	       0x1e295fae4 mach_msg + 76
2   CoreFoundation                	       0x1aae96d30 __CFRunLoopServiceMachPort + 372
3   CoreFoundation                	       0x1aae9b1bc __CFRunLoopRun + 1180
4   CoreFoundation                	       0x1aaeaebc8 CFRunLoopRunSpecific + 600
5   AudioSession                  	       0x1b44baf04 CADeprecated::GenericRunLoopThread::Entry(void*) + 164
6   AudioSession                  	       0x1b44c48f0 CADeprecated::CAPThread::Entry(CADeprecated::CAPThread*) + 92
7   libsystem_pthread.dylib       	       0x21c0909ac _pthread_start + 148
8   libsystem_pthread.dylib       	       0x21c08fe68 thread_start + 8

Thread 8 name:  Realm notification listener
Thread 8:
0   libsystem_kernel.dylib        	       0x1e2960e18 kevent + 8
1   Realm                         	       0x103528db4 realm::_impl::ExternalCommitHelper::listen() + 156
2   Realm                         	       0x103528f04 _hidden#16050_ + 52
3   libsystem_pthread.dylib       	       0x21c0909ac _pthread_start + 148
4   libsystem_pthread.dylib       	       0x21c08fe68 thread_start + 8


Thread 0 crashed with ARM Thread State (64-bit):
    x0: 0x0000000000000000   x1: 0x0000000000000000   x2: 0x0000000000000000   x3: 0x0000000000000000
    x4: 0x00000001c3d320f5   x5: 0x000000016d6e6310   x6: 0x000000000000006e   x7: 0x0000000000000400
    x8: 0x54b9f472dc7144f9   x9: 0x54b9f473de83c179  x10: 0x0000000000000200  x11: 0x000000000000000b
   x12: 0x000000000000000b  x13: 0x00000001ab266a9f  x14: 0x00000001c3d3211b  x15: 0x0000000000000000
   x16: 0x0000000000000148  x17: 0x0000000102f28580  x18: 0x0000000000000000  x19: 0x0000000000000006
   x20: 0x0000000000000103  x21: 0x0000000102f28660  x22: 0x0000000000000000  x23: 0x0000000102f28660
   x24: 0x00000002040a7000  x25: 0x000000016d6e6aa0  x26: 0x000000002b3100d5  x27: 0x00000002040a7000
   x28: 0x00000002040a7000   fp: 0x000000016d6e6280   lr: 0x000000021c0963bc
    sp: 0x000000016d6e6260   pc: 0x00000001e2965b38 cpsr: 0x40000000
   far: 0x0000000201cce768  esr: 0x56000080  Address size fault</a>

Looks like Facebook SDK(?) crashing the app? And what is about Realm? The problem is I can't reproduce the crash anywhere. Simulator or 5 real devices including same phone model as in crash log. Tried different combinations of Debug/Release, setting Exception Breakpoints without any luck.

Will be really thankful for any insight on how to approach this problem or what is going on here. Thank you very much!

Hi, double-checking some hypotheses:

  • I've noticed that Apple reviewers use an iPad to test. Did you try to test on that device?
  • Also, they are logging in from the USA - does your app work from that location? In our app, we forgot we restricted users to Europe and login wasn't working.

Best, André

@andrefreitas

Hi, thank you very much for your answer.

  • i see in the crash log that device is now the iPhone, so probably things changed. But just to make sure I ran on iPad now with same result - all works fine.
  • I don't have user account in the app so no restrictions like this

The problem is that the build of the app that is currently live on App Store (which was approved) is same as this one that crashes - and it works fine. The only thing that changed between builds is two strings with version number and as far as I know nothing relies on those strings. Looks like Realm is crashing on launch (I have database creation on first run) and probably review configuration is different from TestFlight/XCode/App Store version?

Looks like Facebook SDK(?) crashing the app?

I’m not sure how you came to that conclusion. Don’t mistake the FB in FBSScene for Facebook. That stands for FrontBoardServices, which is a system library that’s involved in app lifecycle management.

And what is about Realm?

That’s more in the ballpark. Looking at the crash report it’s clear that your app has crashed due to an unhandled language exception and that this exception is coming out of Realm in frame 2 as the result of your call in frame 5. If you have Realm source code you should symbolicate frame 2 to get a file and line number and then see what that’s complaining about. For details on how to do this, see Adding Identifiable Symbol Names to a Crash Report.

If you don’t have Realm source code, you should ask the Realm folks about this.

Similarly, for frames 11 through 9 and 7 through 5: You need to symbolicate these to find out what part of your code this is.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

@eskimo

Hello, thank you very much for your answer.

Looks like Facebook SDK(?) crashing the app?

I’m not sure how you came to that conclusion. Don’t mistake the FB in FBSScene for Facebook. That stands for FrontBoardServices, which is a system library that’s involved in app lifecycle management.

Yeah I already understood regarding FrontBoardServices, the last thing that I have added to my code was Facebook SDK thats why it got me thinking that FB stands for Facebook yes, sorry about that:)

If you have Realm source code you should symbolicate frame 2 to get a file and line number and then see what that’s complaining about. For details on how to do this, see Adding Identifiable Symbol Names to a Crash Report. If you don’t have Realm source code, you should ask the Realm folks about this.

I have Realm source code but I am not sure how to proceed further. I have symbolicated crash reports I got from App Review as per "Symbolicate the Crash Report in Xcode" in your link and this is what I have included in initial post. Not sure what should I do further here?

I have Realm source code but I am not sure how to proceed further.

OK, let’s see if we can fix that. Looking at your crash report excerpt I see this:

2 Realm      … RLMAccessorContext::createObject(objc_object*, realm::CreatePolicy, bool, realm::ObjKey) + 1776
3 Realm      … RLMAddObjectToRealm + 264
4 RealmSwift … Realm.add(_:update:) + 279776 …

That means that somewhere in the Binary Images section of the crash report there must be Realm and RealSwift binaries. Each of those will have an associated UUID. To symbolicate your crash report you need to find the .dSYM files whose UUID matches those UUIDs.

If you built those binaries from source code, the build process should have creating corresponding .dSYM files. If it didn’t, you need to adjust your build settings so that it does.

If you use binaries built by someone else, you’ll need to get the .dSYM files from them.

You can check you have the right files by matching up UUID, as discussed in Adding Identifiable Symbol Names to a Crash Report.

Once you have the right .dSYM files, the symbolication process should be able to map addresses to source files and line numbers.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

@eskimo

Thank you very much! Here is what I have now:

Last Exception Backtrace:
0   CoreFoundation                	       0x1aaf29288 __exceptionPreprocess + 220
1   libobjc.A.dylib               	       0x1c3c23744 objc_exception_throw + 60
2   Realm                         	       (anonymous namespace)::managedSetter(RLMProperty*, char const*) (in Realm) (RLMAccessor.mm:383)
3   Realm                         	       +[RLMObjectSchema schemaForObjectClass:] (in Realm) (RLMObjectSchema.mm:140)
4   RealmSwift                    	       Realm.add(_:update:) (in RealmSwift) (Realm.swift:438)
5   AppName             	      		   one-time initialization function for pictureObjectIDandWordArray (in AppName) (TestWords.swift:179)
6   AppName             	               specialized TopVideoCard.isChosen.willset (in AppName) (TopVideoCard.swift:91)
7   AppName             	               one-time initialization function for testCategories2 (in AppName) (TestWords.swift:344)
8   RealmSwift                    	       Realm.write<A>(withoutNotifying:_:) (in RealmSwift) (Realm.swift:255)
9   AppName             	               one-time initialization function for pictureObjectIDandWordArray (in AppName) (<compiler-generated>:0)
10  AppName             	               AppDelegate.application(_:didFinishLaunchingWithOptions:) (in AppName) (AppDelegate.swift:257)
11  AppName             	               AppDelegate.application(_:didFinishLaunchingWithOptions:) (in AppName) (<compiler-generated>:0)
12  UIKitCore                     	       0x1ad62f72c -[UIApplication _handleDelegateCallbacksWithOptions:isSuspended:restoreState:] + 340
13  UIKitCore                     	       0x1ad816564 -[UIApplication _callInitializationDelegatesWithActions:forCanvas:payload:fromOriginatingProcess:] + 3572
14  UIKitCore                     	       0x1ad7ff118 -[UIApplication _runWithMainScene:transitionContext:completion:] + 1180
15  UIKitCore                     	       0x1ad65cd34 -[_UISceneLifecycleMultiplexer completeApplicationLaunchWithFBSScene:transitionContext:] + 152
16  UIKitCore                     	       0x1ad4b73b4 _UIScenePerformActionsWithLifecycleActionMask + 104
17  UIKitCore                     	       0x1ad5e1d90 __101-[_UISceneLifecycleMultiplexer 

Here is parts of those files (with line number after //:

RLMAccessor:

    id managedSetter(RLMProperty *prop, const char *type) {
    if (prop.array && prop.type != RLMPropertyTypeLinkingObjects) {
        return makeSetter<id<NSFastEnumeration>>(prop);
    }

    bool boxed = prop.optional || *type == '@';
    switch (prop.type) {
        case RLMPropertyTypeInt:
            if (boxed) {
                return makeSetter<NSNumber<RLMInt> *>(prop);
            }
            switch (*type) {
                case 'c': return makeSetter<char, long long>(prop);
                case 's': return makeSetter<short, long long>(prop);
                case 'i': return makeSetter<int, long long>(prop);
                case 'l': return makeSetter<long, long long>(prop);
                case 'q': return makeSetter<long long>(prop);
                default:
                    @throw RLMException(@"Unexpected property type for Objective-C type code");
            }
        case RLMPropertyTypeFloat:
            return boxed ? makeSetter<NSNumber<RLMFloat> *>(prop) : makeSetter<float>(prop); // line 383
        case RLMPropertyTypeDouble:
            return boxed ? makeSetter<NSNumber<RLMDouble> *>(prop) : makeSetter<double>(prop);
        case RLMPropertyTypeBool:
            return boxed ? makeSetter<NSNumber<RLMBool> *>(prop) : makeSetter<BOOL, bool>(prop);
        case RLMPropertyTypeString:         return makeSetter<NSString *>(prop);
        case RLMPropertyTypeDate:           return makeSetter<NSDate *>(prop);
        case RLMPropertyTypeData:           return makeSetter<NSData *>(prop);
        case RLMPropertyTypeAny:            return nil;
        case RLMPropertyTypeLinkingObjects: return nil;
        case RLMPropertyTypeObject:         return makeSetter<RLMObjectBase *>(prop);
        case RLMPropertyTypeObjectId:       return makeSetter<RLMObjectId *>(prop);
        case RLMPropertyTypeDecimal128:     return makeSetter<RLMDecimal128 *>(prop);
    }
}

RLMObjectSchema:

   if (allProperties.count != [NSSet setWithArray:[allProperties valueForKey:@"name"]].count) {
        NSCountedSet *countedPropertyNames = [NSCountedSet setWithArray:[allProperties valueForKey:@"name"]];
        NSArray *duplicatePropertyNames = [countedPropertyNames filteredSetUsingPredicate:[NSPredicate predicateWithBlock:^BOOL(id object, NSDictionary *) { // line 140
            return [countedPropertyNames countForObject:object] > 1;
        }]].allObjects;

        if (duplicatePropertyNames.count == 1) {
            @throw RLMException(@"Property '%@' is declared multiple times in the class hierarchy of '%@'", duplicatePropertyNames.firstObject, className);
        } else {
            @throw RLMException(@"Object '%@' has properties that are declared multiple times in its class hierarchy: '%@'", className, [duplicatePropertyNames componentsJoinedByString:@"', '"]);
        }
    }

Realm.swift

public func add(_ object: Object, update: UpdatePolicy = .error) {

        if update != .error && object.objectSchema.primaryKeyProperty == nil {

            throwRealmException("'\(object.objectSchema.className)' does not have a primary key and can not be updated")

        }

        // remove any observers still attached to the Realm.

        // if not using SwiftUI, this is a noop

        if #available(iOS 13.0, macOS 10.15, tvOS 13.0, watchOS 6.0, *) {

            SwiftUIKVO.removeObservers(object: object)

        }

        RLMAddObjectToRealm(object, rlmRealm, RLMUpdatePolicy(rawValue: UInt(update.rawValue))!)

    } // line 438

Thank you very much for your help!

I’m not idea how you’re getting from frame 3 to frame 2, but the code at frame 2 suggests that the exception is the result of some sort of runtime type mismatch. What does makeSetter(…) look like?

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

@eskimo

Here is makeSetter, but I actually fixed the issue, for now? (explanation below the code)

template<typename ArgType, typename StorageType=ArgType>

id makeSetter(__unsafe_unretained RLMProperty *const prop) {

    NSUInteger index = prop.index;

    NSString *name = prop.name;

    if (prop.isPrimary) {

        return ^(__unused RLMObjectBase *obj, __unused ArgType val) {

            @throw RLMException(@"Primary key can't be changed after an object is inserted.");

        };

    }



    return ^(__unsafe_unretained RLMObjectBase *const obj, ArgType val) {

        RLMVerifyInWriteTransaction(obj);

        RLMObservationTracker tracker(obj->_realm);

        tracker.willChange(RLMGetObservationInfo(obj->_observationInfo, obj->_row.get_key(), *obj->_info), name);

        if constexpr (std::is_same_v<ArgType, RLMObjectBase *>) {

            tracker.trackDeletions();

        }

        setValue(obj, get_property(obj, index).column_key, static_cast<StorageType>(val));

    };

}

So I actually fixed the issue and have App approved tonight. I had ATTrackingManager.requestTrackingAuthorization in App Delegate which appears to not be a place where you need to use it so I moved it to first viewcontroller. I uploaded it to App review and it got approved. I actually not sure if this was the problem as I told in original post previous version of the app had same code and was approved with working ATTrackingManager.requestTrackingAuthorization in App Delegate (and this function perfectly worked as well). I had no crashes anywhere as well so not sure if this me being lucky this time or ATTrackingManager.requestTrackingAuthorization can cause some deadblock or thread clash randomly with Realm. Maybe you have some insight on why that might happen so people with same problem can find the answer here? Anyway, thank you very much for your help I am very much appreciate it! Please have a wonderful day!

App Crash only on App Review
 
 
Q