Failed to read FormsViewGroup.dll with debugging symbols

So... this error started popping up when I try building as Release on Android.

Failed to read 'C:\Users\gferreira\Documents\Source\Repos\EcoMindMobile\EcoMind\EcoMind.Android\obj\Release\81\linksrc\FormsViewGroup.dll' with debugging symbols. Retrying to load it without it. Error details are logged below.

The details:

1>Mono.Cecil.Cil.SymbolsNotMatchingException: Symbols were found but are not matching the assembly
1>   at Mono.Cecil.ModuleDefinition.ReadSymbols(ISymbolReader reader, Boolean throwIfSymbolsAreNotMaching)
1>   at Mono.Cecil.ModuleReader.ReadSymbols(ModuleDefinition module, ReaderParameters parameters)
1>   at Mono.Cecil.ModuleReader.CreateModule(Image image, ReaderParameters parameters)
1>   at Mono.Cecil.ModuleDefinition.ReadModule(Disposable`1 stream, String fileName, ReaderParameters parameters)
1>   at Mono.Cecil.ModuleDefinition.ReadModule(String fileName, ReaderParameters parameters)
1>   at Mono.Cecil.AssemblyDefinition.ReadAssembly(String fileName, ReaderParameters parameters)
1>   at Java.Interop.Tools.Cecil.DirectoryAssemblyResolver.ReadAssembly(String file)

This same error repeats 3 times throughout the build (found in the build log with Diagnostic MSBuild settings).

It seems to be something related to Xamarin Forms itself and linking, though after more hours than I'd like to admit sinked into this, I have no idea how to solve it. It's just warning, and it builds/works despite this, however just disregarding the warning doesn't seem like the best idea.

I didn't change anything in the release configs or nuget packages, it just started appearing out of the blue last week when I archived the solution.

The seemingly classic mscorlob conflict also appears, though this one has been happening for longer (I've been ignoring it as there doesn't seem to be an actual fix?)

1>There was a conflict between "mscorlib, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e" and "mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089".
1>    "mscorlib, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e" was chosen because it was primary and "mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" was not.

Could they be related? There are Xamarin.Forms references to both versions for some reason. Any ideas? I'm inclined to just start ignoring the warning, because so far things are still working.

Answers

  • YorkGoYorkGo Xamurai CNMember, Xamarin Team Xamurai

    It's just warning, and it builds/works despite this, however just disregarding the warning doesn't seem like the best idea.

    You mean you could build your project in release mode despite the error?

    1>Mono.Cecil.Cil.SymbolsNotMatchingException: Symbols were found but are not matching the assembly

    This happens when you have some unfinished local build changes, usually clean and rebuild will fix this issue. Try doing the following steps:

    • Clean your solution.
    • Delete all bin and obj folder in your solution.
    • Restart your VS
    • Rebuild the project.
  • GabrielBunselmeyerGabrielBunselmeyer ✭✭ Member ✭✭

    @YorkGo said:

    It's just warning, and it builds/works despite this, however just disregarding the warning doesn't seem like the best idea.

    You mean you could build your project in release mode despite the error?

    1>Mono.Cecil.Cil.SymbolsNotMatchingException: Symbols were found but are not matching the assembly

    This happens when you have some unfinished local build changes, usually clean and rebuild will fix this issue. Try doing the following steps:

    • Clean your solution.
    • Delete all bin and obj folder in your solution.
    • Restart your VS
    • Rebuild the project.

    Yes, the app works fine (as far as I can tell) despite the warning. I've gone through that exact list a few times already yesterday (and another today just to make sure) and no change.

    The warning seems to show only when I don't have "Use Shared Runtime" enabled in the Android Options (even in the Debug profile).

  • YorkGoYorkGo Xamurai CNMember, Xamarin Team Xamurai

    Well, if it's only a warning, don't bother with it.

  • TedFalascoTedFalasco USMember

    I had this same issue when building and deploying in Release mode. It was not a problem in Debug. To resolve it, I had to disable linking, which increased the size of my apk considerably (~14MB to ~58MB).

    Unlike the OP, the solution would build, but would not run on a device. It would immediately crash upon initial launch.

    To disable linking:
    Right-click the Android project -> Properties -> Android Options -> Linking -> Select None. I previously had SDK Assemblies Only selected.

  • MimisssMimisss ✭✭ Member ✭✭

    Same problem here. The warning message is the same as the OP's. Αs @TedFalasco said, the build succeeds but the app does not run on a device.

    The problem has to do with linking set to anything but None. You can follow the instructions by uzairali001: https://github.com/xamarin/Xamarin.Forms/issues/5157#issuecomment-463554304 to see the cause of crashing. Investigating the output window I noticed the real error:

    java.lang.ClassNotFoundException: Didn't find class "android.support.v7.widget.FitWindowsFrameLayout" on path: DexPathList [...]

    For me, the solution was to include the following code in one of the Activity classes of the Android project, e.g. MainActivity.cs:

    static bool falseflag = false;
    static MainActivity()
    {
        if (falseflag)
        {
            var ignore = new FitWindowsFrameLayout(Application.Context);
        }
    }
    

    The above was suggested by Jonatha ANTOINE in SO: https://stackoverflow.com/questions/41839625/xamarin-linking-sdk-and-userassemblies-error-inflating-class-android-support-v7

    Now, in Release configuration, I can enable ProGuard, and set Linking to SDK Assemblies Only. Upon archiving, I still get the warning message about failure to read FormsViewGroup.dll but the app runs fine.

    FWIW, changing the ProGuard configuration did not work for me.

    Hope it helps.

Sign In or Register to comment.