ViceSharp.Host.Android 1.2.1

dotnet add package ViceSharp.Host.Android --version 1.2.1
                    
NuGet\Install-Package ViceSharp.Host.Android -Version 1.2.1
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="ViceSharp.Host.Android" Version="1.2.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="ViceSharp.Host.Android" Version="1.2.1" />
                    
Directory.Packages.props
<PackageReference Include="ViceSharp.Host.Android" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add ViceSharp.Host.Android --version 1.2.1
                    
#r "nuget: ViceSharp.Host.Android, 1.2.1"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package ViceSharp.Host.Android@1.2.1
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=ViceSharp.Host.Android&version=1.2.1
                    
Install as a Cake Addin
#tool nuget:?package=ViceSharp.Host.Android&version=1.2.1
                    
Install as a Cake Tool

ViceSharp.Host.Android

PLATFORM-CROSS-001 Android host shell for ViceSharp. This is a thin Avalonia mobile head that reuses the shared App from ViceSharp.Avalonia; the emulator core and UI live in the existing projects, not here.

Build prerequisites

By default this project targets net10.0-android. That requires:

  1. .NET SDK 10.0.201 or newer (global.json pins the rollForward channel).

  2. The android workload:

    dotnet workload install android
    

    On Windows the workload pulls in the Microsoft.Android.Sdk pack (currently 36.x), which bundles the Android SDK, NDK, and an OpenJDK build under C:\Program Files\Android / C:\Program Files (x86)\Android. The SDK target is API 36; the minimum SupportedOSPlatformVersion is 23 because the transitive AndroidX Lifecycle library used by Avalonia.Android requires it.

  3. (Device deploy only) An attached or emulated Android device and adb on PATH. Workload installs adb under the SDK platform-tools directory.

If the workload is missing the project falls back to plain net10.0 so the solution stays buildable on any host:

dotnet build src/ViceSharp.Host.Android/ViceSharp.Host.Android.csproj `
  /p:ViceSharpHostAndroidFallback=true

In fallback mode the project compiles a desktop Avalonia exe instead of an APK. The fallback is solely for solution buildability; it is not a shipping target.

Build the APK

dotnet build src/ViceSharp.Host.Android/ViceSharp.Host.Android.csproj `
  -c Release

Output lands under src/ViceSharp.Host.Android/bin/Release/net10.0-android/ as org.vicesharp.host.android-Signed.apk (debug-signed by the build).

Deploy to a device

  1. Enable USB debugging on the device.

  2. Plug it in (or start an emulator with emulator -avd <name>).

  3. From the repo root:

    dotnet build src/ViceSharp.Host.Android/ViceSharp.Host.Android.csproj `
      -t:Install -c Release
    

    Alternative: adb install bin/Release/.../*-Signed.apk after a normal build.

Known gaps

  • The shared App from ViceSharp.Avalonia currently only wires the classic desktop lifetime (IClassicDesktopStyleApplicationLifetime). On Android the lifetime is ISingleViewApplicationLifetime; the host shell launches an empty surface until the shared App learns the mobile lifetime branch. That work is out of scope for the Phase 1 closeout scaffold.
  • The repo enables IsAotCompatible and EnableTrimAnalyzer globally via Directory.Build.props. Avalonia.Android is not AOT/trim clean today, so this project opts out of those analyzers. Re-enable once Avalonia ships a clean profile.
Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.2.1 151 8/5/2026
1.1.0 115 7/11/2026
1.0.5 109 7/10/2026
1.0.4 115 7/10/2026
1.0.2 102 7/8/2026
1.0.1 122 7/8/2026
0.9.0 111 7/2/2026