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

Visual Studio SDK Manager不显示高版本Android,无法安装Xamarin.Firebase.Messaging求助

Fixing Missing Android 9 (API 28) Target & Xamarin.Firebase.Messaging NuGet Installation

Hey Kenny, let's work through this issue together—missing Android 9+ target versions in Visual Studio is a common roadblock when setting up Firebase Messaging, but we've got several fixes to try:

1. Double-Check Android SDK Manager for API 28 Components

First, let's make sure you actually have the API 28 platform files installed properly:

  • Open Tools > Android > Android SDK Manager in Visual Studio
  • Switch to the SDK Platforms tab, then check the Show Package Details box in the top-right corner
  • Expand the Android 9.0 (Pie) entry, and verify these components are checked:
    • Android SDK Platform 28 (this is the critical one for target version detection)
    • Sources for Android 28 (optional, but helpful for debugging)
    • Intel x86 Atom_64 System Image (if you use emulators)
  • Click Apply to download and install any missing components, then restart Visual Studio

2. Verify Android SDK Path Configuration

Sometimes Visual Studio loses track of where your SDK is stored:

  • Go to Tools > Options > Xamarin > Android Settings
  • Check that the Android SDK Location points to your actual SDK folder (usually C:\Users\<YourUsername>\AppData\Local\Android\Sdk on Windows)
  • If the path is incorrect, click Change to select the right folder, then restart VS

3. Repair Visual Studio's Xamarin Mobile Components

Corrupted or incomplete Visual Studio installations can cause missing targets:

  • Open the Visual Studio Installer, find your installed VS version, and click Modify
  • Expand the Mobile development with .NET workload, and ensure Android SDK setup (API levels 21-33) (or a component that includes API 28) is checked
  • Click Modify to reinstall these components, then restart Visual Studio once done

4. Manually Install API 28 via Command Line (If SDK Manager Fails)

If the Visual Studio SDK Manager still doesn't show API 28, try installing it directly:

  • Navigate to your Android SDK's tools\bin folder (e.g., C:\Users\<YourUsername>\AppData\Local\Android\Sdk\tools\bin)
  • Open a command prompt here, then run:
    sdkmanager.bat "platforms;android-28"
    
  • Wait for the installation to finish, then go back to Visual Studio and refresh the SDK Manager—API 28 should now appear in target version options

5. Emergency Workaround: Force Install NuGet by Editing Project File

If all else fails, you can temporarily bypass the target version check to install the NuGet:

  • Right-click your Xamarin.Android project, select Unload Project
  • Right-click the unloaded project, choose Edit .csproj
  • Find the <TargetFrameworkVersion> element, and change its value to v9.0:
    <TargetFrameworkVersion>v9.0</TargetFrameworkVersion>
    
  • Save the file, reload the project, then install Xamarin.Firebase.Messaging via NuGet Package Manager
  • After installation, you can revert the <TargetFrameworkVersion> to your preferred version (as long as it meets the NuGet package's minimum version requirement)

Once you've got the NuGet installed, don't forget to configure your AndroidManifest.xml with the necessary Firebase permissions and service declarations to get push notifications working!

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

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.05.14 08:23:07