Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Type or namespace 'Droid' does not exist in Lottie.Forms

I'm using Xamarin.Forms with Android and iOS. Trying to make Lottie animation work, but the latest version of Lottie (2.5.4) that supports .NET Standard 2.0 is giving a build error in the Android project:

The type or namespace name 'Droid' does not exist in the namespace 'Lottie.Forms' (are you missing an assembly reference?)

Looking at the Lottie GitHub source shows the namespace and class to be there, so I'm not sure why my Android project cannot find the reference.

I've tried downgrading Lottie, but no luck so far. The earliest version that contains the reference (2.5.0) does not work with .NET Standard.

Ideas?

like image 313
mpalmer78 Avatar asked Jan 28 '23 11:01

mpalmer78


1 Answers

Turns out to be an issue with the Target Framework version for the Xamarin.Forms Android project.

The latest version of Visual Studio 2017 creates new Xamarin.Forms Android projects with Android 7.1 target framework.

Changing to Android 8.1 fixed the compiler issue that could not find the Lottie.Forms.Droid namespace.

Android project settings

like image 77
mpalmer78 Avatar answered Jan 31 '23 19:01

mpalmer78