我正在使用 Xamarin.iOS,这是一个围绕 Objective-C 的 C# 包装器。这个 C# 的调试问题。
我在任务中发生了崩溃,但该信息没有用,这里是:
*** Terminating app due to uncaught exception 'System.AggregateException', reason: 'System.AggregateException: A Task's exception(s) were not observed either by Waiting on the Task or accessing its Exception property. As a result, the unobserved exception was rethrown by the finalizer thread. ---> Newtonsoft.Json.JsonReaderException: Unexpected character encountered while parsing value: <. Path '', line 0, position 0.
at Newtonsoft.Json.JsonTextReader.ParseValue () <0x100b32280 + 0x004b4> in <filename unknown>:0
at Newtonsoft.Json.JsonTextReader.Read () <0x100b2ed80 + 0x00057> in <filename unknown>:0
at Newtonsoft.Json.JsonReader.ReadAndMoveToContent () <0x100b28ee0 + 0x0001f> in <filename unknown>:0
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.ReadForType (Newtonsoft.Json.JsonReader reader, Newtonsoft.Json.Serialization.JsonContract contract, Boolean hasConverter) <0x100b78c70 + 0x00097> in <filename unknown>:0
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.Deserialize (Newtonsoft.Json.JsonReader reader, System.Type objectType, Boolean checkAdditionalContent) <0x100b6f700 + 0x0008f> in <filename unknown>:0
--- End of inner exception stack trace ---
---> (Inner Exception #0) Newtonsoft.Json.JsonReaderException: Unexpected character encountered while parsing value: <. Path '', line 0, position 0.
at Newtonsoft.Json.JsonTextReader.ParseValue () <0x100b32280 + 0x004b4> in <filename unknown>:0
at Newtonsoft.Json.JsonTextReader.Read () <0x100b2ed80 + 0x00057> in <filename unknown>:0
at Newtonsoft.Json.JsonReader.ReadAndMoveToContent () <0x100b28ee0 + 0x0001f> in <filename unknown>:0
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.ReadForType (Newtonsoft.Json.JsonReader reader, Newtonsoft.Json.Serialization.JsonContract contract, Boolean hasConverter) <0x100b78c70 + 0x00097> in <filename unknown>:0
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.Deserialize (Newtonsoft.Json.JsonReader reader, System.Type objectType, Boolean checkAdditionalContent) <0x100b6f700 + 0x0008f> in <filename unknown>:0 <---
据此,我知道在某处我有一个反序列化的 JSON,它接收 HTML(以 <
开头)。
现在我正在滚动浏览其余的崩溃信息,然后我开始思考这些信息:
Thread 1:
0 libsystem_kernel.dylib 0x000000018ca1c16c 0x18ca1b000 + 4460
1 CoreFoundation 0x000000018da17cec 0x18d93b000 + 904428
2 CoreFoundation 0x000000018da15908 0x18d93b000 + 895240
3 CoreFoundation 0x000000018d944048 0x18d93b000 + 36936
4 CFNetwork 0x000000018e135fd0 0x18e067000 + 847824
5 Foundation 0x000000018e55347c 0x18e449000 + 1090684
6 libsystem_pthread.dylib 0x000000018cb00850 0x18cafd000 + 14416
7 libsystem_pthread.dylib 0x000000018cb00760 0x18cafd000 + 14176
8 libsystem_pthread.dylib 0x000000018cafddac 0x18cafd000 + 3500
这些数字代表什么?我可以从这些数字中检索调用了哪个文件甚至调用了哪个方法吗?
最佳答案
上面的崩溃信息显示了崩溃期间的事件帧列表
1 CoreFoundation 0x000000018da17cec 0x18d93b000 + 904428
上述示例框架的详细信息
1 : Frame Number
CoreFoundation : Framework Name
0x000000018da17cec : Address of the called Function
0x18d93b000 : File Name
+8740 : Line of the Code
要从地址获取函数名和文件名,我们需要符号化崩溃报告。
您在此问题中发布的部分崩溃日志显示了所有默认的 iOS 框架,因此即使在符号化之后您也可能无法获得那么多有用的信息。您需要寻找带有 App 名称的事件框架,这可能会为您提供有用的信息。
我们可以使用许多第三方库来报告崩溃,例如 Fabric、Hockey App、Flurry。
Hockey ap似乎支持 Xamarin,希望对您有所帮助。
关于c# - 我能从这样的崩溃信息中得到有用的信息吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41164868/