gpt4 book ai didi

android - 带有 multidex 的 Xamarin Android - Debug模式下的错误

转载 作者:塔克拉玛干 更新时间:2023-11-02 08:44:27 26 4
gpt4 key购买 nike

我创建了 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 反编译器(通过此 article)。但是现在我不知道要寻找什么以及问题是什么。

有什么想法吗?

最佳答案

我解决了这个问题。

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

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

关于android - 带有 multidex 的 Xamarin Android - Debug模式下的错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44481749/

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