带有multidex的Xamarin Android - 调试模式下的bug

Fet*_*mos 9 android xamarin.android dex xamarin.forms android-multidex

我创建了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()
Run Code Online (Sandbox Code Playgroud)

对于分析,我使用--dex2jar和Java Decompiler(通过本文).但现在我不知道该寻找什么,以及有什么问题.

有任何想法吗?

Fet*_*mos 0

我解决了这个问题。

这是详细描述我的用户案例:

  1. 我使用了PCL库。
  2. 我需要将 Azure 移动客户端更新到版本 4.0。此版本仅不支持 PCL .NET 标准。1.4.
  3. 但我有使用 Xamarin Forms 的 Windows Phone 项目。WP 不支持 .Net 标准 1.4
  4. 我在我的解决方案中添加了新库(.NET Standard.1.4)。我将文件从 PCL 作为链接添加到该库。
  5. 然后就出现了这个错误。起初它是一个漂浮的虫子 - 但后来它是永久性的。
  6. 我花了整整两个工作日寻找这个错误的原因。我发现应用程序掉落的地方。
  7. 我从我的库(.Net Standard)中删除了关联文件,然后添加了它。现在调试工作了。