Forum Xamarin.Android

Xamarin Android with multidex - bugs

ZenDroidZenDroid USMember ✭✭✭

I created Xamarin Forms app. I use multidex for Android (many libraries). I use multidex.keep file with MultiDexMainDexList option. Now deployment is work. But I have two problems:

  1. I get exception in debug mode

    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.b__41_0(MethodDefinition method, MetadataReader reader)
    в Mono.Cecil.ModuleDefinition.Read[TItem,TRet](TRet& variable, TItem item, Func3 read) в Mono.Cecil.MethodDefinition.get_Body() Mono.Cecil.MethodDefinition.get_DebugInformation() в Mono.Debugging.Soft.SoftDebuggerSession.LoadPdbType(TypeDefinition type, Dictionary2 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&
    в 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()

2.Instead of the application icon, I see a black square.

For analysis I use - dex2jar and Java Decompiler(by this article). But now I do not know what to look for and what is the problems.

Any ideas?


  • ZenDroidZenDroid USMember ✭✭✭

    This problem is solved. It was a problem with my project.

  • EricBrunnerEricBrunner USMember ✭✭

    @ZenDroid Today I got the samo in VS2017. What solved your problem? thanks for any help.

  • ZenDroidZenDroid USMember ✭✭✭

    Hi @EricBruner
    I will describe in detail my user case
    1. I used PCL library.
    2. I need update Azure Mobile Client to version 4.0. This version not supported PCL only .NET Standard. 1.4.
    3. But I have Windows Phone project with Xamarin Forms. WP not supported .Net Standard 1.4
    4. I add new library in my solution( .NET Standard. 1.4). I added files to this library from my PCL as link.
    5. Then there was this error. At first it was a floating bug - but then it was permanent.
    6. I spent two full working days looking for the cause of this error. I found a place where the application was dropping.
    7. I deleted the associated file from my library(.Net Standard), and then added it. Now debugging works.

  • EricBrunnerEricBrunner USMember ✭✭
    @ZenDroid So the issue was source link from .NET Standard to the original sources in the PCL? After you copied the sources from PCL to .NET Standard lib and included them in the .NET Standard lib the error was gone?!

    I have the same scenario. My issue can bw solved when I work in the root dir directory of C:\
    instead of C:\Source\VSTS

    Sounds strange. Yeah it truely is, but thats the case. If you are interested I filed a bug here:

    Thanks for your time writing the detailed reply.
Sign In or Register to comment.