Did not find reference matching RestoreAssemblyResources AssemblyName metadata

/packages/Xamarin.Build.Download.0.4.2/build/Xamarin.Build.Download.targets: Error: Did not find reference matching RestoreAssemblyResources AssemblyName metadata 'Google.AppIndexing, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'

getting this build error even though the library is referenced in the project.

tried this http://evanp.net/xamarin-did-not-find-reference-matching-restoreassemblyresources-assemblyname-metadata/
but didn't help

Posts

  • JGoldbergerJGoldberger USXamarin Team, University Xamurai

    @Jagadeeshwar

    Is this still an issue? If so, can you share your .csproj file and your packages.config file?

  • MelbourneDeveloperMelbourneDeveloper AUMember ✭✭✭

    I'm getting this error.

    Did not find reference matching RestoreAssemblyResources AssemblyName metadata 'Xamarin.Android.Support.v4'

    I have cleaned my solution again and again. I have also done full Git cleans to make sure there are no files left over again and again, but the problem persists.

  • EvanPEvanP CAMember ✭✭

    @MelbourneDeveloper said:
    I'm getting this error.

    Did not find reference matching RestoreAssemblyResources AssemblyName metadata 'Xamarin.Android.Support.v4'

    I have cleaned my solution again and again. I have also done full Git cleans to make sure there are no files left over again and again, but the problem persists.

    Luis posted a link to my blog, have you tried doing what I outlined there?

  • MelbourneDeveloperMelbourneDeveloper AUMember ✭✭✭

    I fixed this problem a while back through trial and error, but I don't remember how I fixed it.

  • SamihELSAKHAWISamihELSAKHAWI USMember ✭✭

    I've got the same error:

    "Did not find reference matching RestoreAssemblyResources AssemblyName metadata 'Xamarin.Android.Support.Annotations' Random Number C:\Users\samih pc\Documents\Visual Studio 2015\Projects\Random Number\packages\Xamarin.Build.Download.0.4.4\build\Xamarin.Build.Download.targets 92

    I search for my .csproj but i didn't find the line.

    I found this when i open my .csproj with a text editor:

    <?xml version="1.0" encoding="utf-8"?>


    Nexus 4
    Theme.DeviceDefault

    how can i fix my error?

    thanks a lot.

  • Ferry.de.BoerFerry.de.Boer NLUniversity ✭✭
    edited July 5

    For me it seemed an assembly in a package was corrupt. When I copied the folder for that package from another similar solution that did work, the problem disappeared. So clearing your NuGet cache might solve the issue.

    The hint that brought me there was than when I tried uninstalling and reinstalling the package it said:
    Failed to update binding redirects for ... : Could not load file or assembly 'Xamarin.Android.Support.Annotations.dll' or one of its dependencies. An attempt was made to load a program with an incorrect format.

  • MichaelMoodyMichaelMoody GBMember

    Following on from Ferry, I realised that two of the Xamarin Android packages had an issue:
    1. Xamarin.Android.Support.Compat
    2. Xamarin.Android.Support.Annotations

    Both of these DLLs in the packages directory were of zero file size. I copied the DLL from another project matching the same version to fix the ...Annotations issue which then revealed the same problem with the ...Compat package.

    The issue also presented itself in the MainActivity.cs file for the Xamarin.Android project: Both the Resource.Layout.Tabbar and Resource.Layout.Toolbar were showing an error on Tabbar and Toolbar.

    This happened for me on a new project: I was testing sqlite-net-pcl with the v2.0.0-alpha2 release of the SQLiteNetExtensions since in my main project I was receiving "Don't know about System.Collections.Generic.List`1", which is reported as mixed up versioning between those two packages (even though it all looks fine).
    1. Created New Xamarin.Forms Project (PCL).
    2. Updated Xamarin.Android support libraries to the latest version (25.3.1) and restarted Visual Studio.
    3. Updated Xamarin.Build.Download and restarted Visual Studio.
    4. Installed my SQLite related packages and did a first build.
    5. Cleaning and rebuilding and all that jazz did not work. I would imagine deleting the packages directory is another route if you don't have a project with the missing DLLs of the same version and allowing NuGet to pull them again. I expected there would have been some checksum with NuGet to notice the files weren't correct after decompression.

  • santosbjsantosbj COMember

    I have a similar problem after upgrading to v25.3.1 over all Xamarin.Android.* in the project.

    Build FAILED.

    C:\Program Files (x86)\MSBuild\14.0\bin\Microsoft.Common.CurrentVersion.targets(1819,5): warning MSB3245: Could not resolve this reference. Could not locate the assembly "Xamarin.Android.Support.Annotations, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL". Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors. C:\Program Files (x86)\MSBuild\14.0\bin\Microsoft.Common.CurrentVersion.targets(1819,5): warning MSB3247: Found conflicts between different versions of the same dependent assembly. In Visual Studio, double-click this warning (or select it and press Enter) to fix the conflicts; otherwise, add the following binding redirects to the "runtime" node in the application configuration file: <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"><dependentAssembly><assemblyIdentity name="System.Runtime" culture="neutral" publicKeyToken="b03f5f7f11d50a3a" /><bindingRedirect oldVersion="0.0.0.0-4.1.0.0" newVersion="4.1.0.0" /></dependentAssembly></assemblyBinding> ..\Packages\Xamarin.Build.Download.0.4.6\build\Xamarin.Build.Download.targets(93,3): error : Did not find reference matching RestoreAssemblyResources AssemblyName metadata 'Xamarin.Android.Support.Annotations'

    Attach an project example.

    Thanks!

  • curiositycuriosity USMember ✭✭

    For me, I had to delete the Xamarin.Android.Support.Annotations package from packages folder. And then it built without a problem.

  • MikhalUkhinMikhalUkhin USMember

    I solved this problem in three steps (missing AppCompat):
    1) Clear solution
    2) Clear nuget packeges cache (via VS)
    3) Update AppCompat to lower version (then you can return it to up to date version)

    Thats all, and it works for me.

Sign In or Register to comment.