Com.Nkkinsoft.Android.Lottie 6.7.1

There is a newer version of this package available.
See the version list below for details.

Requires NuGet 2.12 or higher.

dotnet add package Com.Nkkinsoft.Android.Lottie --version 6.7.1
                    
NuGet\Install-Package Com.Nkkinsoft.Android.Lottie -Version 6.7.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="Com.Nkkinsoft.Android.Lottie" Version="6.7.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Com.Nkkinsoft.Android.Lottie" Version="6.7.1" />
                    
Directory.Packages.props
<PackageReference Include="Com.Nkkinsoft.Android.Lottie" />
                    
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 Com.Nkkinsoft.Android.Lottie --version 6.7.1
                    
#r "nuget: Com.Nkkinsoft.Android.Lottie, 6.7.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 Com.Nkkinsoft.Android.Lottie@6.7.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=Com.Nkkinsoft.Android.Lottie&version=6.7.1
                    
Install as a Cake Addin
#tool nuget:?package=Com.Nkkinsoft.Android.Lottie&version=6.7.1
                    
Install as a Cake Tool

Com.Nkkinsoft.Android.Lottie

<p align="center"> <img src="assets/icon.svg" alt="Lottie Android Binding" width="128" height="128"> </p>

<p align="center"> <strong>Lottie Android binding for .NET (nkkinsoft fork)</strong> — Render After Effects animations natively on Android via Xamarin/.NET for Android. Based on <a href="https://github.com/airbnb/lottie-android/releases/tag/6.7.1">lottie-android 6.7.1</a>. </p>

<p align="center"> <a href="https://www.nuget.org/packages/Com.Nkkinsoft.Android.Lottie/"><img src="https://img.shields.io/nuget/v/Com.Nkkinsoft.Android.Lottie?label=NuGet&color=cc3333&logo=nuget" alt="NuGet version"></a> <a href="https://www.nuget.org/packages/Com.Nkkinsoft.Android.Lottie/"><img src="https://img.shields.io/nuget/dt/Com.Nkkinsoft.Android.Lottie?color=0d9488&logo=nuget" alt="NuGet downloads"></a> <a href="https://github.com/airbnb/lottie-android/releases"><img src="https://img.shields.io/badge/Upstream-6.7.1-14b8a6?logo=airbnb" alt="Upstream version"></a> <a href="https://github.com/Baseflow/LottieXamarin"><img src="https://img.shields.io/badge/Binding-LottieXamarin-661818?logo=xamarin" alt="Binding project"></a> <img src="https://img.shields.io/badge/TFM-net11.0--android-0f1011?logo=dotnet" alt="Target framework"> <img src="https://img.shields.io/badge/C%23-15-0f1011?logo=csharp" alt="C# 15"> <img src="https://img.shields.io/badge/Nullable-enabled-14b8a6" alt="Nullable enabled"> <a href="LICENSE"><img src="https://img.shields.io/badge/License-Apache--2.0-cc3333" alt="License"></a> </p>

Note: This is a community fork by nkkinsoft. The official Airbnb package is Com.Airbnb.Android.Lottie. This fork provides .NET 11 / C# 15 support, modernized bindings, and trimmed-AOT compatibility.


Why this binding?

Concern This Package
Upstream parity Tracks lottie-android releases (currently 6.7.1)
Modern .NET net11.0-android, C# 15, primary constructors, Nullable/ImplicitUsings enabled
Trim-safe Annotated for .NET trimming / R8; no reflection surprises in Release AOT
Async-first Task<T> overloads for every load operation (FromAssetFileNameAsync, FromJsonStringAsync, …)
Zero-conflict Single Metadata.xml — no duplicate-type conflicts with other AndroidX bindings
Symbols included .snupkg published alongside every release for debugging

Install


<PackageReference Include="Com.Nkkinsoft.Android.Lottie" Version="6.7.1" />


dotnet add package Com.Nkkinsoft.Android.Lottie --version 6.7.1

Requirements

  • .NET 11+ (net11.0-android)
  • Android API 24+ (minSdkVersion 24)
  • AndroidX.AppCompat 1.8.0+ (transitive)
  • OkIO 3.9.0+ (transitive)

Quick Start


<com.airbnb.lottie.LottieAnimationView
    android:id="@+id/animation_view"
    android:layout_width="200dp"
    android:layout_height="200dp"
    app:lottie_fileName="animation.json"
    app:lottie_autoPlay="true"
    app:lottie_loop="true" />
// Activity.cs
using Com.Airbnb.Lottie;

protected override void OnCreate(Bundle? savedInstanceState)
{
    base.OnCreate(savedInstanceState);
    SetContentView(Resource.Layout.activity_main);

    var animationView = FindViewById<LottieAnimationView>(Resource.Id.animation_view);
    
    // Or load programmatically
    animationView.SetAnimation("loading.json");
    animationView.PlayAnimation();
}

using Com.Airbnb.Lottie;
using System.Threading.Tasks;

public async Task LoadAnimationAsync(string assetName)
{
    var composition = await LottieComposition.Factory.FromAssetFileNameAsync(this, assetName);
    if (composition != null)
    {
        animationView.Composition = composition;
        animationView.PlayAnimation();
    }
}

// From JSON string (network-loaded animations)
var json = await httpClient.GetStringAsync("https://cdn.example.com/anim.json");
var composition = await LottieComposition.Factory.FromJsonStringAsync(json);

// From stream
using var stream = await httpClient.GetStreamAsync("https://cdn.example.com/anim.json");
var composition = await LottieComposition.Factory.FromInputStreamAsync(stream);

Key Types

Type Purpose
LottieAnimationView Main view — XML or programmatic
LottieComposition Immutable animation data model
LottieComposition.Factory Async/sync loaders (FromAssetFileNameAsync, FromJsonStringAsync, …)
LottieDrawable Drawable variant for ImageView/custom views
LottieProperty Animated properties (color, position, opacity, …) for dynamic overrides
ICancellable Cancel in-flight loads
LottieListener / IOnCompositionLoadedListener Completion callbacks

Migration from 4.x (LottieXamarin 4.2.2)

4.x 6.x
LottieAnimationView.SetAnimation(string) LottieAnimationView.SetAnimation(string) ✓
LottieAnimationView.Progress LottieAnimationView.Progress ✓
LottieCompositionFactory.FromAssetFileName LottieComposition.Factory.FromAssetFileNameAsync
LottieCompositionFactory.FromJsonString LottieComposition.Factory.FromJsonStringAsync
app:lottie_rawRes Removed — use FromAssetFileNameAsync
LottieDrawable Still available, prefer LottieAnimationView

Breaking: Sync factory methods return ICancellable; prefer *Async overloads returning Task<LottieComposition?>.


ProGuard / R8 / Trimming

No extra rules needed — the binding includes [DynamicallyAccessedMembers] annotations. For full AOT (ReleaseFullAot):

<PropertyGroup Condition="'$(Configuration)' == 'ReleaseFullAot'">
  <PublishReadyToRun>true</PublishReadyToRun>
  <EnableLLVM>true</EnableLLVM>
  <AndroidLinkMode>SdkOnly</AndroidLinkMode>
  <TrimmerRootAssembly Include="Com.Nkkinsoft.Android.Lottie" RootMode="library" />
</PropertyGroup>

Building from Source

# Prerequisites
dotnet workload install android

# Build Release (produces .nupkg + .snupkg in artifacts/)
dotnet build Lottie.Android/Lottie.Android.csproj -c Release

# Pack
dotnet pack Lottie.Android/Lottie.Android.csproj -c Release -o ./artifacts

Versioning

This Package Upstream (lottie-android) Notes
6.7.1 6.7.1 .NET 11, C# 15, async API
4.2.2 4.2.2 Legacy Xamarin binding

We follow upstream minor.patch; binding improvements increment build metadata (e.g., 6.7.1.1).


License

Apache-2.0 — same as lottie-android.

Copyright 2024 Baseflow
Copyright 2024 Airbnb, Inc.
Copyright 2024 nkkinsoft (fork modifications)

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.

Contributing

  1. Fork the binding repo
  2. Update Directory.Build.props version
  3. Modernize any generated .cs in Additions/
  4. Run dotnet build -c Release — zero warnings expected
  5. Open PR with upstream changelog link

Product Compatible and additional computed target framework versions.
.NET net11.0-android37.0 is compatible. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on Com.Nkkinsoft.Android.Lottie:

Package Downloads
Com.Nkkinsoft.Maui.Lottie

Lottie for .NET MAUI 10 and 11 (community fork): an AnimationView control that renders After Effects animations natively on Android (lottie-android 6.7.1) and iOS (lottie-ios 2.5.x). Register it with builder.UseLottie().

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
6.7.5 103 11/16/2026
6.7.4 102 11/14/2026
6.7.3 99 11/14/2026
6.7.2 90 11/12/2026
6.7.1 96 11/12/2026