gpt4 book ai didi

ios - FBFinalClassViolationException:FBAdTimer是最终类,不能被子类化

转载 作者:行者123 更新时间:2023-12-01 16:02:22 25 4
gpt4 key购买 nike

我们已经升级到FBAudienceNetwork v.4.26,现在,每次尝试在Xcode中运行单元测试目标时,都会看到以下未处理的运行时异常:

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

奇怪的是,在我们的代码库(包括所有第三方依赖项)中,唯一包含单词“FBAdTimer”的文件是:
λ ~/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

最佳答案

根据https://developers.facebook.com/bugs/147221075773612/的说法,FBAudienceNetwork不能同时位于测试目标和与其一起加载的主捆绑包中。解决方案是从Podfile中的测试目标中删除依赖项:

target 'App' do
use_frameworks!

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

target 'AppTests' do

end

关于ios - FBFinalClassViolationException:FBAdTimer是最终类,不能被子类化,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46718482/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com