You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

安装Xamarin.GooglePlayServices相关包时遇AssemblyName元数据缺失错误求助

Fix for "Missing AssemblyName metadata on RestoreAssemblyResources item" with Xamarin.GooglePlayServices Packages

Hey there, I’ve dealt with this exact metadata error when working with those specific Xamarin Google Play Services NuGet versions before. Let me share the fixes that resolved it for me and other developers:

  • Clean & Rebuild Your Solution
    Start with the simplest fix first: In Visual Studio, right-click your solution > select Clean Solution. Once that finishes, right-click again > Rebuild Solution. Cached build artifacts often get corrupted, and this clears them out to start fresh.

  • Delete the Xamarin Build Download Cache
    The error directly points to the cache folder at C:\Users\sp\AppData\Local\XamarinBuildDownloadCache. Navigate to this directory, delete the entire playservicesbasement-16.2.0 folder (and any other related cached AAR folders if you spot them). Restart Visual Studio, then go to Tools > NuGet Package Manager > Manage NuGet Packages for Solution and click Restore to re-download the correct files with proper metadata.

  • Align NuGet Package Versions
    Mixing mismatched minor versions of Google Play Services packages can trigger metadata issues. Double-check that all your Xamarin.GooglePlayServices.* packages are on a compatible version track. For example, try upgrading/downgrading both Xamarin.GooglePlayServices.Basement and Xamarin.GooglePlayServices.Tasks to the same major/minor version set to ensure dependency consistency.

  • Manually Add AssemblyName Metadata (Advanced)
    If the above steps don’t work, you can manually edit your project file to fix the missing metadata:

    1. Right-click your Android project > Unload Project
    2. Right-click the unloaded project > Edit [YourProjectName].csproj
    3. Look for RestoreAssemblyResources entries referencing playservicesbasement-16.2.0.aar, and add the AssemblyName attribute like this:
      <RestoreAssemblyResources Include="C:\Users\sp\AppData\Local\XamarinBuildDownloadCache\playservicesbasement-16.2.0\playservicesbasement-16.2.0.aar">
        <AssemblyName>playservicesbasement</AssemblyName>
      </RestoreAssemblyResources>
      
    4. Save the file, reload the project, and rebuild.
  • Update Visual Studio & Xamarin Tools
    Outdated IDE or Xamarin Android tools can cause package restoration glitches. Open Visual Studio > Tools > Get Tools and Features, check for updates under the Mobile development with .NET workload, install any available updates, then restart and try again.

内容的提问来源于stack exchange,提问作者Sourav Paria

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.09 16:18:16