iOS 8-无法符号化来自自定义动态框架的符号 [英] iOS 8 - Unable to symbolicate symbols coming from custom dynamic framework
问题描述
这是我所拥有的: -名为VacationSpots(.APP文件)的iOS应用
Here is what I have: - iOS app called VacationSpots (.APP file)
-
app dSYM文件
app dSYM file
名为VSUtilities(.framework文件)的动态框架
dynamic framework named VSUtilities (.framework file)
动态框架dSYM文件
以下是示例项目源代码: https://www. dropbox.com/s/nl32xlk98lnl1mv/VacationSpots.zip?dl=0
Here is the sample project source code: https://www.dropbox.com/s/nl32xlk98lnl1mv/VacationSpots.zip?dl=0
我通过强制展开nil可选来使应用程序在启动时崩溃.
I made the app crash at launch by force unwrapping a nil optional.
以下是符号崩溃报告的一部分.请注意,未标记VSUtilities调用:
Below is part of the symbolicated crash report. Notice that VSUtilities calls are not symbolicated:
Thread 0 name: Dispatch queue: com.apple.main-thread
Thread 0 Crashed:
0 libswiftCore.dylib 0x00333470 0x1d1000 + 1451120
1 VSUtilities 0x001c0bd8 0x1b9000 + 31704
2 VacationSpots 0x0007a418 SpotsViewController.awakeFromNib() -> () (SpotsViewController.swift:38)
3 VacationSpots 0x0007a4b8 @objc SpotsViewController.awakeFromNib() -> () (SpotsViewController.swift:0)
4 UIKit 0x2940036a -[UINib instantiateWithOwner:options:] + 1910
5 UIKit 0x29641818 -[UIStoryboard instantiateViewControllerWithIdentifier:] + 196
6 UIKit 0x2964197a -[UIStoryboard instantiateInitialViewController] + 58
7 UIKit 0x291f8ea0 -[UIApplication _loadMainStoryboardFileNamed:bundle:] + 84
8 UIKit 0x28fccebc -[UIApplication _loadMainInterfaceFile] + 260
9 UIKit 0x291f7d80 -[UIApplication _runWithMainScene:transitionContext:completion:] + 1256
10 UIKit 0x2920bb9c __84-[UIApplication _handleApplicationActivationWithScene:transitionContext:completion:]_block_invoke3228 + 36
11 UIKit 0x291f53aa -[UIApplication workspaceDidEndTransaction:] + 134
12 FrontBoardServices 0x26100c7e -[FBSSerialQueue _performNext] + 230
13 FrontBoardServices 0x26100f70 -[FBSSerialQueue _performNextFromRunLoopSource] + 48
14 CoreFoundation 0x24ddf68e __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 14
15 CoreFoundation 0x24ddf27c __CFRunLoopDoSources0 + 452
16 CoreFoundation 0x24ddd5ea __CFRunLoopRun + 794
17 CoreFoundation 0x24d30bf8 CFRunLoopRunSpecific + 520
18 CoreFoundation 0x24d309e4 CFRunLoopRunInMode + 108
19 UIKit 0x28fc65bc -[UIApplication _run] + 524
20 UIKit 0x28fc0ba0 UIApplicationMain + 144
21 VacationSpots 0x00081d4c main (AppDelegate.swift:26)
22 libdyld.dylib 0x249df872 start + 2
这是symbolicatecrash
命令输出的一部分:
Here is part of the symbolicatecrash
command output:
Finding Symbols:
.fetching symbol file for VSUtilities--[undef]
Searching []...-- NO MATCH
Searching in Spotlight for dsym with UUID of 9acae8d3326233adaaea24609e951306
Running mdfind "com_apple_xcode_dsym_uuids == 9ACAE8D3-3262-33AD-AAEA-24609E951306"
Running mdls -name com_apple_xcode_dsym_paths \/Users\/maxkorytko\/Library\/Developer\/Xcode\/DerivedData\/VacationSpots\-citeoysntsbhwwfzcqytfuzhnqze\/Build\/Products\/Debug\-iphoneos\/VSUtilities\.framework\.dSYM
@dsym_paths = ( /Users/maxkorytko/Library/Developer/Xcode/DerivedData/VacationSpots-citeoysntsbhwwfzcqytfuzhnqze/Build/Products/Debug-iphoneos/VSUtilities.framework.dSYM/Contents/Resources/DWARF/VSUtilities )
@exec_names = ( VSUtilities )
Running mdfind "kMDItemContentType == com.apple.application-bundle && (kMDItemAlternateNames == 'VSUtilities.app' || kMDItemDisplayName == 'VSUtilities' || kMDItemDisplayName == 'VSUtilities.app')"
Running mdfind "kMDItemContentType == public.unix-executable && kMDItemDisplayName == 'VSUtilities'"
Did not find executable for dsym
## Warning: Can't find any unstripped binary that matches version of /var/mobile/Containers/Bundle/Application/BE14C237-9798-4030-9806-11F3386A0077/VacationSpots.app/Frameworks/VSUtilities.framework/VSUtilities
..fetching symbol file for VacationSpots--[undef]
Searching []...-- NO MATCH
Searching in Spotlight for dsym with UUID of d2731d399b5132329532fea91df1ca19
Running mdfind "com_apple_xcode_dsym_uuids == D2731D39-9B51-3232-9532-FEA91DF1CA19"
Running mdls -name com_apple_xcode_dsym_paths \/Users\/maxkorytko\/Library\/Developer\/Xcode\/DerivedData\/VacationSpots\-citeoysntsbhwwfzcqytfuzhnqze\/Build\/Products\/Debug\-iphoneos\/VacationSpots\.app\.dSYM
@dsym_paths = ( /Users/maxkorytko/Library/Developer/Xcode/DerivedData/VacationSpots-citeoysntsbhwwfzcqytfuzhnqze/Build/Products/Debug-iphoneos/VacationSpots.app.dSYM/Contents/Resources/DWARF/VacationSpots )
@exec_names = ( VacationSpots )
Running mdfind "kMDItemContentType == com.apple.application-bundle && (kMDItemAlternateNames == 'VacationSpots.app' || kMDItemDisplayName == 'VacationSpots' || kMDItemDisplayName == 'VacationSpots.app')"
Running mdfind "kMDItemContentType == public.unix-executable && kMDItemDisplayName == 'VacationSpots'"
Running /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/lipo -info '/Users/maxkorytko/Library/Developer/Xcode/DerivedData/VacationSpots-citeoysntsbhwwfzcqytfuzhnqze/Build/Products/Debug-iphoneos/VacationSpots.app/VacationSpots'
Running /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/otool -arch armv7 -l '/Users/maxkorytko/Library/Developer/Xcode/DerivedData/VacationSpots-citeoysntsbhwwfzcqytfuzhnqze/Build/Products/Debug-iphoneos/VacationSpots.app/VacationSpots'
Number of symbols in /Users/maxkorytko/Library/Developer/Xcode/DerivedData/VacationSpots-citeoysntsbhwwfzcqytfuzhnqze/Build/Products/Debug-iphoneos/VacationSpots.app/VacationSpots: 335 + 2081 = 2416
Found executable /Users/maxkorytko/Library/Developer/Xcode/DerivedData/VacationSpots-citeoysntsbhwwfzcqytfuzhnqze/Build/Products/Debug-iphoneos/VacationSpots.app/VacationSpots
-- MATCH
推荐答案
今天遇到了类似的情况.我的情况有两个问题:
Faced something similar today. There were two problems in my case:
-
.app中的.framework不会获得足够索引"/获取mdfind的所有元数据,例如kMDItemDisplayName,除非我将其移出了.app.
.framework inside .app would not get "indexed enough"/get all the metadata for mdfind, like kMDItemDisplayName, unless I moved it out of .app.
symbolicatecrash正在使用带有"kMDItemContentType == public.unix-executable"的mdfind,而我的框架可执行文件的实际kMDItemContentType是"public.data".
symbolicatecrash was using mdfind with "kMDItemContentType == public.unix-executable", while the real kMDItemContentType for my framework executable was "public.data".
通过以下方式解决它:
-
将.framework移出.app(以我为例,我将所有内容移至了桌面,以确保将其正确编入索引)
Moving .framework out of .app (in my case I moved all the stuff to Desktop, to be sure that it will be indexed correctly)
修改symbolicatecrash(的副本)不仅要查找"kMDItemContentType == public.unix-executable",还要查找"kMDItemContentType == public.data"
Modifying (copy of) symbolicatecrash to look not only for "kMDItemContentType == public.unix-executable" but for "kMDItemContentType == public.data"
P.S.您可以使用mdls获取文件的索引元数据属性:
P.S. You can use mdls to get the indexed metadata attributes of a file:
MacBook-Pro-GE:~ eg$ mdls -name kMDItemContentType ~/Desktop/OPASAppKit.framework/OPASAppKit
kMDItemContentType = "public.data"
MacBook-Pro-GE:~ eg$ mdls -name kMDItemContentType ~/Desktop/OPASAppKit.framework/OPASAppKit
kMDItemContentType = "public.data"
对于symbolicatecrash的修改版,我不确定是否可以按原样在此处发布,但这是一个区别,只有一行被更改了.
As for modified version of symbolicatecrash, I'm not sure whether I can post it here as is, but here's a diff, there's just a single line that's changed.
顺便说一句,看起来Xcode也使用symbolicatecrash来进行符号化,因此在Xcode中修补脚本也使我也可以使用自定义动态框架来对崩溃进行符号化.
Btw, it looks like Xcode uses symbolicatecrash for symbolicating as well, so patching the script inside Xcode allowed me to symbolicate crashes with custom dynamic frameworks there too.
这篇关于iOS 8-无法符号化来自自定义动态框架的符号的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!