【发布时间】:2017-11-12 21:15:28
【问题描述】:
我创建了 Xamarin Forms 应用程序。我为 Android 使用 multidex(许多库)。 我使用带有 MultiDexMainDexList 选项的 multidex.keep 文件。现在部署工作。但我在调试模式下遇到异常:
System.ArgumentException: The offset and length have exceeded the bounds of the array or the counter value exceeds the number of elements from the pointer to the end of the original collection.
в System.Buffer.BlockCopy(Array src, Int32 srcOffset, Array dst, Int32 dstOffset, Int32 count)
в Mono.Cecil.Metadata.GuidHeap.Read(UInt32 index)
в Mono.Cecil.MetadataReader.InitializeCustomDebugInformations()
в Mono.Cecil.MetadataReader.GetCustomDebugInformation(ICustomDebugInformationProvider provider)
в Mono.Cecil.Cil.PortablePdbReader.Read(MethodDefinition method)
в Mono.Cecil.Cil.CodeReader.ReadMethodBody()
в Mono.Cecil.Cil.CodeReader.ReadMethodBody(MethodDefinition method)
в Mono.Cecil.MethodDefinition.<>c.<get_Body>b__41_0(MethodDefinition method, MetadataReader reader)
в Mono.Cecil.ModuleDefinition.Read[TItem,TRet](TRet& variable, TItem item, Func`3 read)
в Mono.Cecil.MethodDefinition.get_Body()
Mono.Cecil.MethodDefinition.get_DebugInformation()
в Mono.Debugging.Soft.SoftDebuggerSession.LoadPdbType(TypeDefinition type, Dictionary`2 fileToSourceFileInfos)
в Mono.Debugging.Soft.SoftDebuggerSession.LoadPdbFile(String assemblyFileName, String pdbFileName)
в Mono.Debugging.Soft.SoftDebuggerSession.LoadDebugFile(String assemblyFileName, String debugFileName, Func`3 loadDebugFile)
в Mono.Debugging.Soft.SoftDebuggerSession.CheckBetterMatch(TypeMirror type, String file, Int32 line, Int32 column, Location found)
в Mono.Debugging.Soft.SoftDebuggerSession.FindLocationByMethod(MethodMirror method, String file, Int32 line, Int32 column, Boolean& insideTypeRange)
в Mono.Debugging.Soft.SoftDebuggerSession.FindLocationByType(TypeMirror type, String file, Int32 line, Int32 column, Boolean& genericMethod, Boolean& insideTypeRange)
в Mono.Debugging.Soft.SoftDebuggerSession.ResolveBreakpoints(TypeMirror type)
в Mono.Debugging.Soft.SoftDebuggerSession.HandleTypeLoadEvents(TypeLoadEvent[] events)
в Mono.Debugging.Soft.SoftDebuggerSession.HandleEventSet(EventSet es)
в Mono.Debugging.Soft.SoftDebuggerSession.EventHandler()
为了进行分析,我使用 - dex2jar 和 Java Decompiler(通过 article)。 但是现在我不知道要寻找什么以及有什么问题。
有什么想法吗?
【问题讨论】:
-
所以这发生在
Debug配置中。上面的异常看起来更像是连接到软调试器的问题。由于在上面的跟踪中没有任何 Multidex 任务的痕迹,我很犹豫说它与 Multidex 相关,直到我们有一个最小的复制。您可以在帖子中添加一个吗? -
嗨,乔恩。我的调试器现在正在工作!这是我的项目的问题。我的项目中有 XF 2.3.4.247。我安装了 XF 2.3.5.239(pre),然后删除它并安装了稳定版本 2.3.4.247。在那之后调试工作。感谢您的博客 - 这是非常有用的信息。我在等你关于 Xamarin Android 的书。
标签: android xamarin.android xamarin.forms dex android-multidex