Com.Nkkinsoft.Android.Lottie
6.7.4
See the version list below for details.
Requires NuGet 2.12 or higher.
dotnet add package Com.Nkkinsoft.Android.Lottie --version 6.7.4
NuGet\Install-Package Com.Nkkinsoft.Android.Lottie -Version 6.7.4
<PackageReference Include="Com.Nkkinsoft.Android.Lottie" Version="6.7.4" />
<PackageVersion Include="Com.Nkkinsoft.Android.Lottie" Version="6.7.4" />
<PackageReference Include="Com.Nkkinsoft.Android.Lottie" />
paket add Com.Nkkinsoft.Android.Lottie --version 6.7.4
#r "nuget: Com.Nkkinsoft.Android.Lottie, 6.7.4"
#:package Com.Nkkinsoft.Android.Lottie@6.7.4
#addin nuget:?package=Com.Nkkinsoft.Android.Lottie&version=6.7.4
#tool nuget:?package=Com.Nkkinsoft.Android.Lottie&version=6.7.4
Lottie for .NET Android
Native Lottie animation rendering for .NET 10 and .NET 11 Android applications.
Com.Nkkinsoft.Android.Lottie binds Airbnb's lottie-android 6.7.1. This community-maintained fork retains the Com.Airbnb.Lottie namespace and the Lottie.Android assembly name.
| Package | Version | Targets | Minimum Android |
|---|---|---|---|
| Com.Nkkinsoft.Android.Lottie | 6.7.4 | net10.0-android, net11.0-android | API 24 |
Install
dotnet add package Com.Nkkinsoft.Android.Lottie --version 6.7.4
Use a published feed version, or add the directory containing your locally built .nupkg as a NuGet source. Installing the MAUI control package brings in the appropriate binding dependency automatically.
Your first animation
Add hello.json to your application's Assets folder with build action AndroidAsset. Create the native view on the Android UI thread:
using Com.Airbnb.Lottie;
var animation = new LottieAnimationView(this); // Inside an Activity.
SetContentView(animation);
animation.SetAnimation("hello.json");
animation.PlayAnimation();
The native view can also be declared in Android XML:
<com.airbnb.lottie.LottieAnimationView
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="240dp"
app:lottie_fileName="hello.json"
app:lottie_autoPlay="true"
app:lottie_loop="true" />
Playback and loading
animation.PauseAnimation();
animation.ResumeAnimation();
animation.CancelAnimation();
animation.Progress = 0.5f;
animation.Speed = 1.25f;
animation.RepeatCount = LottieDrawable.Infinite;
animation.RepeatMode = LottieDrawable.Restart;
// Choose one input appropriate to your application.
animation.SetAnimationFromJson(json);
animation.SetAnimationFromUrl("https://your-domain.example/hello.json");
Replace the example URL with your own animation endpoint. Network animations require the Android INTERNET permission. Use native failure/composition listeners to observe asynchronous loading. Keep references to listeners while in use, detach them during cleanup, and stop playback when the owning UI is disposed.
The older LottieComposition.Factory async convenience methods remain for compatibility. They do not provide a native failure callback; a failed load can remain pending until cancellation. Prefer the current native factory/listener APIs for new code. Do not assume a caller stream can be closed while a native asynchronous parse is still running.
Dependencies and packaging
- Bundled native Android artifact:
lottie-6.7.1.aar. - Managed dependencies:
Square.OkIO3.17.0.1 andXamarin.AndroidX.AppCompat1.8.0; their transitive dependencies are resolved by NuGet. - The package includes assemblies, the AAR, XML documentation, portable PDBs, this README, icon and license.
- A companion
.snupkgcontains portable debugging symbols. Symbol generation is not evidence that a build has been committed or independently reproduced.
Build from this repository
dotnet restore Lottie.Android/Lottie.Android.csproj
dotnet pack Lottie.Android/Lottie.Android.csproj -c Release -o artifacts/packages-release
The root global.json selects .NET SDK 11.0.100. Install compatible Android workloads/targeting packs for both declared targets. A successful build can still report generated-binding warnings; the metadata transforms intentionally omit some generic/internal native APIs. Device playback, trimming and AOT need separate application-level validation.
6.7.4 release notes
- Incremented the managed package version from 6.7.3.
- Added this Android-specific package README and updated package README inclusion.
- Native lottie-android remains 6.7.1; no native-version upgrade is implied.
License and support
Apache-2.0. Retain the repository and bundled native dependency attribution. This is an independent fork, not an official Airbnb release.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0-android36.0 is compatible. net11.0-android37.0 is compatible. |
-
net10.0-android36.0
- Square.OkIO (>= 3.17.0.1)
- Xamarin.AndroidX.AppCompat (>= 1.8.0)
-
net11.0-android37.0
- Square.OkIO (>= 3.17.0.1)
- Xamarin.AndroidX.AppCompat (>= 1.8.0)
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.