Crash in AuthSession.authorizeRequest(withArguments:)
Describe the bug Crash on google sign in for some users.
Could not cast value of type '__NSCFNumber' (0x102c04f80) to 'NSString' (0x1fbb66048).
Crashed: com.google.GTLRServiceRequestCreation
0 libsystem_kernel.dylib 0xc2d4 __pthread_kill + 8
1 libsystem_pthread.dylib 0x859c pthread_kill + 268
2 libsystem_c.dylib 0x77b08 abort + 128
3 libswiftCore.dylib 0x3ccae4 swift::fatalError(unsigned int, char const*, ...) + 134
4 libswiftCore.dylib 0x3ccb04 swift::warningv(unsigned int, char const*, char*) + 30
5 libswiftCore.dylib 0x3c0440 swift::swift_dynamicCastFailure(swift::TargetMetadata<swift::InProcess> const*, swift::TargetMetadata<swift::InProcess> const*, char const*) + 78
6 libswiftCore.dylib 0x3c04bc swift::_conformsToProtocol(swift::OpaqueValue const*, swift::TargetMetadata<swift::InProcess> const*, swift::TargetProtocolDescriptorRef<swift::InProcess>, swift::TargetWitnessTable<swift::InProcess> const**) + 122
7 libswiftCore.dylib 0x3c5864 swift_dynamicCastImpl(swift::OpaqueValue*, swift::OpaqueValue*, swift::TargetMetadata<swift::InProcess> const*, swift::TargetMetadata<swift::InProcess> const*, swift::DynamicCastFlags) + 342
8 Foundation 0x110154 closure #2 in static Dictionary._forceBridgeFromObjectiveC(_:result:) + 788
9 Foundation 0x10fe30 partial apply for closure #2 in static Dictionary._forceBridgeFromObjectiveC(_:result:) + 36
10 Foundation 0x10f860 _NativeDictionary.init(_unsafeUninitializedCapacity:allowingDuplicates:initializingWith:) + 376
11 Foundation 0x10f564 static Dictionary._unconditionallyBridgeFromObjectiveC(_:) + 948
12 App 0xe9c3c AuthSession.authorizeRequest(withArguments:) + 228 (AuthSession.swift:228)
13 App 0xe9df4 @objc AuthSession.authorizeRequest(_:completionHandler:) + 200 (AuthSession.swift:200)
14 App 0x66d8c -[GTMSessionFetcher authorizeRequest] + 1770 (GTMSessionFetcher.m:1770)
15 App 0x637f0 -[GTMSessionFetcher beginFetchMayDelay:mayAuthorize:mayDecorate:] + 780 (GTMSessionFetcher.m:780)
16 App 0x827c8 -[GTLRService handleObjectRequestCompletionWithRequest:objectClass:dataToPost:mayAuthorize:completionHandler:executingQuery:ticket:] + 912 (GTLRService.m:912)
17 App 0x821fc __137-[GTLRService fetchObjectWithURL:objectClass:bodyObject:dataToPost:ETag:httpMethod:mayAuthorize:completionHandler:executingQuery:ticket:]_block_invoke + 669 (GTLRService.m:669)
18 App 0x80e98 __120-[GTLRService objectRequestForURL:object:contentType:contentLength:ETag:httpMethod:additionalHeaders:ticket:completion:]_block_invoke + 429 (GTLRService.m:429)
19 App 0x80a24 __63-[GTLRService requestForURL:ETag:httpMethod:ticket:completion:]_block_invoke + 337 (GTLRService.m:337)
20 libdispatch.dylib 0x2248 _dispatch_call_block_and_release + 32
21 libdispatch.dylib 0x3fa8 _dispatch_client_callout + 20
22 libdispatch.dylib 0xb5cc _dispatch_lane_serial_drain + 768
23 libdispatch.dylib 0xc124 _dispatch_lane_invoke + 380
24 libdispatch.dylib 0x1738c _dispatch_root_queue_drain_deferred_wlh + 288
25 libdispatch.dylib 0x16bd8 _dispatch_workloop_worker_thread + 540
26 libsystem_pthread.dylib 0x3680 _pthread_wqthread + 288
27 libsystem_pthread.dylib 0x1474 start_wqthread + 8
Environment
- Device: iPhone 13 Pro
- OS: iOS 18.3.1
- GTMSessionFetcher v3.5.0
- GTMAppAuth v4.1.1
- GoogleSignIn-iOS v8.0.0
- Swift Package manager
Android 8.0.0 (API 26) y Android 8.1.0 (API 27):
https://github.com/google/GTMAppAuth/issues/253#issue-2884014903
Describe the bug Crash on google sign in for some users.
Could not cast value of type '__NSCFNumber' (0x102c04f80) to 'NSString' (0x1fbb66048).
Crashed: com.google.GTLRServiceRequestCreation 0 libsystem_kernel.dylib 0xc2d4 __pthread_kill + 8 1 libsystem_pthread.dylib 0x859c pthread_kill + 268 2 libsystem_c.dylib 0x77b08 abort + 128 3 libswiftCore.dylib 0x3ccae4 swift::fatalError(unsigned int, char const*, ...) + 134 4 libswiftCore.dylib 0x3ccb04 swift::warningv(unsigned int, char const*, char*) + 30 5 libswiftCore.dylib 0x3c0440 swift::swift_dynamicCastFailure(swift::TargetMetadata<swift::InProcess> const*, swift::TargetMetadata<swift::InProcess> const*, char const*) + 78 6 libswiftCore.dylib 0x3c04bc swift::_conformsToProtocol(swift::OpaqueValue const*, swift::TargetMetadata<swift::InProcess> const*, swift::TargetProtocolDescriptorRef<swift::InProcess>, swift::TargetWitnessTable<swift::InProcess> const**) + 122 7 libswiftCore.dylib 0x3c5864 swift_dynamicCastImpl(swift::OpaqueValue*, swift::OpaqueValue*, swift::TargetMetadata<swift::InProcess> const*, swift::TargetMetadata<swift::InProcess> const*, swift::DynamicCastFlags) + 342 8 Foundation 0x110154 closure #2 in static Dictionary._forceBridgeFromObjectiveC(_:result:) + 788 9 Foundation 0x10fe30 partial apply for closure #2 in static Dictionary._forceBridgeFromObjectiveC(_:result:) + 36 10 Foundation 0x10f860 _NativeDictionary.init(_unsafeUninitializedCapacity:allowingDuplicates:initializingWith:) + 376 11 Foundation 0x10f564 static Dictionary._unconditionallyBridgeFromObjectiveC(_:) + 948 12 App 0xe9c3c AuthSession.authorizeRequest(withArguments:) + 228 (AuthSession.swift:228) 13 App 0xe9df4 @objc AuthSession.authorizeRequest(_:completionHandler:) + 200 (AuthSession.swift:200) 14 App 0x66d8c -[GTMSessionFetcher authorizeRequest] + 1770 (GTMSessionFetcher.m:1770) 15 App 0x637f0 -[GTMSessionFetcher beginFetchMayDelay:mayAuthorize:mayDecorate:] + 780 (GTMSessionFetcher.m:780) 16 App 0x827c8 -[GTLRService handleObjectRequestCompletionWithRequest:objectClass:dataToPost:mayAuthorize:completionHandler:executingQuery:ticket:] + 912 (GTLRService.m:912) 17 App 0x821fc __137-[GTLRService fetchObjectWithURL:objectClass:bodyObject:dataToPost:ETag:httpMethod:mayAuthorize:completionHandler:executingQuery:ticket:]_block_invoke + 669 (GTLRService.m:669) 18 App 0x80e98 __120-[GTLRService objectRequestForURL:object:contentType:contentLength:ETag:httpMethod:additionalHeaders:ticket:completion:]_block_invoke + 429 (GTLRService.m:429) 19 App 0x80a24 __63-[GTLRService requestForURL:ETag:httpMethod:ticket:completion:]_block_invoke + 337 (GTLRService.m:337) 20 libdispatch.dylib 0x2248 _dispatch_call_block_and_release + 32 21 libdispatch.dylib 0x3fa8 _dispatch_client_callout + 20 22 libdispatch.dylib 0xb5cc _dispatch_lane_serial_drain + 768 23 libdispatch.dylib 0xc124 _dispatch_lane_invoke + 380 24 libdispatch.dylib 0x1738c _dispatch_root_queue_drain_deferred_wlh + 288 25 libdispatch.dylib 0x16bd8 _dispatch_workloop_worker_thread + 540 26 libsystem_pthread.dylib 0x3680 _pthread_wqthread + 288 27 libsystem_pthread.dylib 0x1474 start_wqthread + 8Environment
- Device: iPhone 13 Pro
- OS: iOS 18.3.1
- GTMSessionFetcher v3.5.0
- GTMAppAuth v4.1.1
- GoogleSignIn-iOS v8.0.0
- Swift Package manager Joniur Rahman [email protected]
I am also facing this crash in iOS 18. Anyone found the solution ?
refresh_token_expires_in is number type
- (NSDictionary *)updatedEMMParametersWithParameters:(NSDictionary *)parameters { NSMutableDictionary *allParameters = [(parameters ?: @{}) mutableCopy]; for (NSString *key in parameters.allKeys) { id value = parameters[key]; if ([value isKindOfClass:[NSNumber class]]) { allParameters[key] = [value stringValue]; } } return [self parametersWithParameters:allParameters emmSupport:allParameters[kEMMSupportParameterName] isPasscodeInfoRequired:allParameters[kEMMPasscodeInfoParameterName] != nil]; }
- (NSDictionary *)updatedEMMParametersWithParameters:(NSDictionary *)parameters { NSMutableDictionary *allParameters = [(parameters ?: @{}) mutableCopy]; for (NSString *key in parameters.allKeys) { id value = parameters[key]; if ([value isKindOfClass:[NSNumber class]]) { allParameters[key] = [value stringValue]; } } return [self parametersWithParameters:allParameters emmSupport:allParameters[kEMMSupportParameterName] isPasscodeInfoRequired:allParameters[kEMMPasscodeInfoParameterName] != nil]; }
I don't know if it will cause any other problems
same issue on 5.0.0
@mdmathias @brnnmrls
I'm encountering this error as well