Ravil Khusainov
Ravil Khusainov

Reputation: 43

Tapkey Mobile SDK crash on iOS - java.lang.IllegalArgumentException

I am trying to integrate Tap key Mobile SDK to existing iOS application project.

Whenever I try to call TKMServiceFactoryBuilder().build() I get application crash with this exception java.lang.IllegalArgumentException

Adding stack trace from the tryCatchObjc. It does not explain, since above method calls seems to happen inside the private implementation of Mobile SDK.

    0   CoreFoundation                      0x000000019cb9b270 37A3D601-9398-3DC2-9D00-1B162726A4C9 + 1159792
    1   libobjc.A.dylib                     0x00000001b0930480 objc_exception_throw + 56
    2   LattisCore                          0x0000000108736300 +[GG_Gson_Preconditions __metadata] + 0
    3   LattisCore                          0x0000000108741d68 -[GGGsonBuilder registerTypeHierarchyAdapterWithIOSClass:withId:] + 136
    4   LattisCore                          0x00000001087adc14 NetTpkyMcRestGsonUtils_createGsonWithBoolean_ + 136
    5   LattisCore                          0x00000001087ade48 +[NetTpkyMcRestGsonUtils initialize] + 52
    6   libobjc.A.dylib                     0x00000001b090bd30 5A4C477A-8AB3-3703-A88E-3AF91D10189A + 7472
    7   libobjc.A.dylib                     0x00000001b0911c5c 5A4C477A-8AB3-3703-A88E-3AF91D10189A + 31836
    8   libobjc.A.dylib                     0x00000001b0912fb8 5A4C477A-8AB3-3703-A88E-3AF91D10189A + 36792
    9   libobjc.A.dylib                     0x00000001b0921234 5A4C477A-8AB3-3703-A88E-3AF91D10189A + 94772
    10  libobjc.A.dylib                     0x00000001b090c500 5A4C477A-8AB3-3703-A88E-3AF91D10189A + 9472
    11  libswiftCore.dylib                  0x00000001a082f994 swift_getInitializedObjCClass + 20
    12  LattisCore                          0x0000000108810b4c $s15TapkeyMobileLib20TkFileManagerDaoImplC6toJson33_524952B98DFA1635BB8A45B608126161LLySSypSgFTf4nd_n + 36
    13  LattisCore                          0x000000010880d190 $s15TapkeyMobileLib20TkFileManagerDaoImplC4save4withAE0J2IdySSSg_AGypSgtF + 88
    14  LattisCore                          0x000000010880d34c $s15TapkeyMobileLib20TkFileManagerDaoImplC4save4withAE0J2IdySSSg_AGypSgtFTo + 188
    15  LattisCore                          0x000000010881b364 $s15TapkeyMobileLib09TKMMobileC11DataContextC04initeF021dataMigrationListeneryAA07TKMDatafiJ0_pSg_tF + 1368
    16  LattisCore                          0x000000010882a1a8 $s15TapkeyMobileLib24TKMServiceFactoryBuilderC0a7ServiceE4ImplCyAeCc33_1ADD77A5E2214429E5597CBFBC4D153BLlfcTf4gn_n + 792
    17  LattisCore                          0x0000000108829720 $s15TapkeyMobileLib24TKMServiceFactoryBuilderC5buildAA0dE0_pyF + 60
    18  LattisCore                          0x0000000107c91b1c $s10LattisCore9AppRouterCACycfcyycfU_ + 56
    19  LattisCore                          0x000000010882d72c $s15TapkeyMobileLib12tryCatchObjcySo11NSExceptionCSgyycFyycfU_TA + 20
    20  LattisCore                          0x0000000107c4eba4 $sIeg_IeyB_TR + 52
    21  LattisCore                          0x00000001087e327c tryObjc + 52
    22  LattisCore                          0x000000010882d030 $s15TapkeyMobileLib12tryCatchObjcySo11NSExceptionCSgyycF + 264
    23  LattisCore                          0x0000000107c913b8 $s10LattisCore9AppRouterCACycfc + 3748
    24  LattisCore                          0x0000000107c91b50 $s10LattisCore9AppRouterCACycfcTo + 20
    25  LattisCore                          0x0000000107c8fb40 $s10LattisCore9AppRouterCACycfC + 28
    26  LattisCore                          0x0000000107c8fb0c $s10LattisCore9AppRouterC6shared_WZ + 32
    27  libdispatch.dylib                   0x000000010a84d32c _dispatch_client_callout + 16
    28  libdispatch.dylib                   0x000000010a84ec74 _dispatch_once_callout + 84
    29  libswiftCore.dylib                  0x00000001a08258d8 swift_once + 44
    30  LattisCore                          0x0000000107c8fb88 $s10LattisCore9AppRouterC6sharedACvau + 64
    31  Lattis Prod                         0x0000000102a6ef7c $s6Lattis11AppDelegateC11application_29didFinishLaunchingWithOptionsSbSo13UIApplicationC_SDySo0j6LaunchI3KeyaypGSgtF + 104
    32  Lattis Prod                         0x0000000102a6f3bc $s6Lattis11AppDelegateC11application_29didFinishLaunchingWithOptionsSbSo13UIApplicationC_SDySo0j6LaunchI3KeyaypGSgtFTo + 212
    33  UIKitCore                           0x000000019f43c7b0 E136F680-E4B6-3BCE-8132-4A39EC1ED9FA + 11716528
    34  UIKitCore                           0x000000019f43e150 E136F680-E4B6-3BCE-8132-4A39EC1ED9FA + 11723088
    35  UIKitCore                           0x000000019f443f24 E136F680-E4B6-3BCE-8132-4A39EC1ED9FA + 11747108
    36  UIKitCore                           0x000000019eb168c0 E136F680-E4B6-3BCE-8132-4A39EC1ED9FA + 2123968
    37  UIKitCore                           0x000000019f03b2c8 _UIScenePerformActionsWithLifecycleActionMask + 96
    38  UIKitCore                           0x000000019eb173a8 E136F680-E4B6-3BCE-8132-4A39EC1ED9FA + 2126760
    39  UIKitCore                           0x000000019eb16eb0 E136F680-E4B6-3BCE-8132-4A39EC1ED9FA + 2125488
    40  UIKitCore                           0x000000019eb171d4 E136F680-E4B6-3BCE-8132-4A39EC1ED9FA + 2126292
    41  UIKitCore                           0x000000019eb16a90 E136F680-E4B6-3BCE-8132-4A39EC1ED9FA + 2124432
    42  UIKitCore                           0x000000019eb1e72c E136F680-E4B6-3BCE-8132-4A39EC1ED9FA + 2156332
    43  UIKitCore                           0x000000019ef5538c E136F680-E4B6-3BCE-8132-4A39EC1ED9FA + 6574988
    44  UIKitCore                           0x000000019f053184 _UISceneSettingsDiffActionPerformChangesWithTransitionContext + 248
    45  UIKitCore                           0x000000019eb1e420 E136F680-E4B6-3BCE-8132-4A39EC1ED9FA + 2155552
    46  UIKitCore                           0x000000019e95dae4 E136F680-E4B6-3BCE-8132-4A39EC1ED9FA + 318180
    47  UIKitCore                           0x000000019e95c590 E136F680-E4B6-3BCE-8132-4A39EC1ED9FA + 312720
    48  UIKitCore                           0x000000019e95d730 E136F680-E4B6-3BCE-8132-4A39EC1ED9FA + 317232
    49  UIKitCore                           0x000000019f4420fc E136F680-E4B6-3BCE-8132-4A39EC1ED9FA + 11739388
    50  UIKitCore                           0x000000019ef7ba84 E136F680-E4B6-3BCE-8132-4A39EC1ED9FA + 6732420
    51  FrontBoardServices                  0x00000001ab675d00 C97A2E0C-03AA-37C0-A55C-4854EAF0E8C3 + 36096
    52  FrontBoardServices                  0x00000001ab69d4fc C97A2E0C-03AA-37C0-A55C-4854EAF0E8C3 + 197884
    53  FrontBoardServices                  0x00000001ab683420 C97A2E0C-03AA-37C0-A55C-4854EAF0E8C3 + 91168
    54  FrontBoardServices                  0x00000001ab69d214 C97A2E0C-03AA-37C0-A55C-4854EAF0E8C3 + 197140
    55  libdispatch.dylib                   0x000000010a84d32c _dispatch_client_callout + 16
    56  libdispatch.dylib                   0x000000010a8507e4 _dispatch_block_invoke_direct + 232
    57  FrontBoardServices                  0x00000001ab6c1e04 C97A2E0C-03AA-37C0-A55C-4854EAF0E8C3 + 347652
    58  FrontBoardServices                  0x00000001ab6c1acc C97A2E0C-03AA-37C0-A55C-4854EAF0E8C3 + 346828
    59  FrontBoardServices                  0x00000001ab6c1fa0 C97A2E0C-03AA-37C0-A55C-4854EAF0E8C3 + 348064
    60  CoreFoundation                      0x000000019cb1a8a8 37A3D601-9398-3DC2-9D00-1B162726A4C9 + 633000
    61  CoreFoundation                      0x000000019cb1a7a8 37A3D601-9398-3DC2-9D00-1B162726A4C9 + 632744
    62  CoreFoundation                      0x000000019cb19afc 37A3D601-9398-3DC2-9D00-1B162726A4C9 + 629500
    63  CoreFoundation                      0x000000019cb14018 37A3D601-9398-3DC2-9D00-1B162726A4C9 + 606232
    64  CoreFoundation                      0x000000019cb137d0 CFRunLoopRunSpecific + 572
    65  GraphicsServices                    0x00000001b3255570 GSEventRunModal + 160
    66  UIKitCore                           0x000000019f4402d0 E136F680-E4B6-3BCE-8132-4A39EC1ED9FA + 11731664
    67  UIKitCore                           0x000000019f44584c UIApplicationMain + 164
    68  Lattis Prod                         0x0000000102a6fd68 main + 84
    69  libdyld.dylib                       0x000000019c7f2140 FFBE9840-BC5A-338D-8AE0-C6FFE5E834CC + 4416

Upvotes: 3

Views: 139

Answers (2)

Harald
Harald

Reputation: 475

[Update 01.12.2021]

With the version 2.19.2.0 of the Tapkey Mobile SDK for iOS, this issue is resolved. It can now be linked with cocoapod against an own dynamic framework without running in an issue with duplicate symbols.

[Old answer]

The issue seems to be cocoapod related: https://github.com/CocoaPods/CocoaPods/issues/7155

The Tapkey Mobile SDK is and uses static libraries/frameworks. When the Tapkey Mobile SDK is used with cocoapods and an own dynamic framework, cocoapods configure the project so, that the static libs/frameworks are linked against the target app AND the dynamic framework. This causes that there duplicate symbols during runtime, which causes this crash.

To resolve this issue the linking flags must be removed from the target app.

Upvotes: 1

Ravil Khusainov
Ravil Khusainov

Reputation: 43

Ok. Finally, I was able to find the difference in "project setup" which lead to the crash inside the Tapkey Mobile SDK. I have multiple targets inside the project and I use framework to share the logic (and dependencies) between all the targets. That crash happens when Mobile SDK is added to the framework target using cocoapods and that framework target is added to the final iOS application target.

Upvotes: 0

Related Questions