2017-10-12 3 views
0

Nous avons mis à jour à FBAudienceNetwork v.4.26, et maintenant nous voyons l'exception d'exécution non gérée suivant tout moment, nous essayons de gérer nos tests unitaires cible dans Xcode:FBFinalClassViolationException: FBAdTimer est une classe finale et ne peut pas être sous-

2017-10-12 15:30:41.229388-0500 App[60509:1890366] *** Terminating app due to uncaught exception 'FBFinalClassViolationException', reason: 'FBAdTimer is a final class and cannot be subclassed. FBAdTimer' 
*** First throw call stack: 
(
    0 CoreFoundation      0x000000011ca991cb __exceptionPreprocess + 171 
    1 libobjc.A.dylib      0x000000011c1bef41 objc_exception_throw + 48 
    2 AppTests     0x00000001399cc669 +[FBAdTimer scheduledTimerWithTimeInterval:repeats:block:] + 0 
    3 libobjc.A.dylib      0x000000011c1bfa14 CALLING_SOME_+initialize_METHOD + 19 
    4 libobjc.A.dylib      0x000000011c1bfdae _class_initialize + 276 
    5 libobjc.A.dylib      0x000000011c1c65e7 lookUpImpOrForward + 225 
    6 libobjc.A.dylib      0x000000011c1d63d4 _objc_msgSend_uncached + 68 
    7 AppTests     0x00000001399c8ec4 +[FBAdFingerprinter load] + 46 
    8 libobjc.A.dylib      0x000000011c1c069b call_load_methods + 695 
    9 libobjc.A.dylib      0x000000011c1c12f3 load_images + 70 
    10 ???         0x000000010ff7adac 0x0 + 4562857388 
    11 ???         0x000000010ff876c5 0x0 + 4562908869 
    12 ???         0x000000010ff86898 0x0 + 4562905240 
    13 ???         0x000000010ff8692c 0x0 + 4562905388 
    14 ???         0x000000010ff7d956 0x0 + 4562868566 
    15 ???         0x000000010ff83076 0x0 + 4562890870 
    16 libdyld.dylib      0x000000011ddeba47 dlopen + 86 
    17 CoreFoundation      0x000000011ca49808 _CFBundleDlfcnLoadBundle + 152 
    18 CoreFoundation      0x000000011ca49694 _CFBundleLoadExecutableAndReturnError + 324 
    19 Foundation       0x0000000114060ec1 -[NSBundle loadAndReturnError:] + 520 
    20 IDEBundleInjection     0x0000000110057860 __XCBundleInjection + 798 
    21 ???         0x000000010ff8bc16 0x0 + 4562926614 
    22 ???         0x000000010ff8be46 0x0 + 4562927174 
    23 ???         0x000000010ff876da 0x0 + 4562908890 
    24 ???         0x000000010ff86898 0x0 + 4562905240 
    25 ???         0x000000010ff8692c 0x0 + 4562905388 
    26 ???         0x000000010ff7b15d 0x0 + 4562858333 
    27 ???         0x000000010ff7ec98 0x0 + 4562873496 
    28 ???         0x000000010ff7a3d4 0x0 + 4562854868 
    29 ???         0x0000000118742510 0x0 + 4705232144 
    30 ???         0x0000000118740a39 0x0 + 4705225273 
    31 ???         0x000000011873c249 0x0 + 4705206857 
    32 ???         0x000000011873c036 0x0 + 4705206326 
    33 ???         0x0000000000000007 0x0 + 7 
) 
libc++abi.dylib: terminating with uncaught exception of type NSException 

assez curieusement, au sein de notre base de code (y compris toutes les dépendances tiers), le seul fichier qui contient le mot « FBAdTimer » est:

λ ~/Projects/iOS/app/ IOS-6370* grep -iR "FBAdTimer" . 
Binary file ./Pods/FBAudienceNetwork/FBAudienceNetwork.framework/FBAudienceNetwork matches 
Binary file ./App.xcworkspace/xcuserdata/silver.xcuserdatad/UserInterfaceState.xcuserstate matches 

Répondre

1

Selon https://developers.facebook.com/bugs/147221075773612/, FBAudienceNetwork ne peut pas figurer à la fois dans la cible de test et dans l'ensemble principal qui la charge. La solution consiste à supprimer la dépendance de la cible de test dans Podfile:

target 'App' do 
    use_frameworks! 

    pod 'FBAudienceNetwork' # Only present in the main app target 
end 

target 'AppTests' do 

end