0

Hello I'm trying to run xamarin forms with Lottie for Xamarin and it's crashing. I have installed the Forms Package and the Droid Package and I get the following error:

Unhandled Exception:

Java.Lang.ClassNotFoundException: Didn't find class "md58995ca22a59cb7d445dac899fcf4189b.AnimationViewRenderer" on path: DexPathList[[zip file "/mnt/asec/com.GIC.AthkarApps-1/base.apk"],nativeLibraryDirectories=[/mnt/asec/com.GIC.AthkarApps-1/lib/arm, /vendor/lib, /system/lib]]

Also, I've added the following code to the MainActivity Class:

namespace EasyNETApp.Droid
{
    [Activity(Label = "EasyNETApp", Icon = "@drawable/icon", Theme = "@style/MainTheme", MainLauncher = true, ConfigurationChanges = ConfigChanges.ScreenSize | ConfigChanges.Orientation)]
    public class MainActivity : global::Xamarin.Forms.Platform.Android.FormsAppCompatActivity
    {
        protected override void OnCreate(Bundle bundle)
        {
            TabLayoutResource = Resource.Layout.Tabbar;
            ToolbarResource = Resource.Layout.Toolbar;

            base.OnCreate(bundle);

            global::Xamarin.Forms.Forms.Init(this, bundle);
            Lottie.Forms.Droid.AnimationViewRenderer.Init();//Reference for Lottie
            LoadApplication(new App());
        }
    }
}

And I have placed the .josn file as an asset:

Lottie video cam json

amrswalha
  • 372
  • 8
  • 20
  • 2
    [Here is a tutorial](https://blog.xamarin.com/bring-stunning-animations-to-your-apps-with-lottie/) – Robbit Jan 16 '18 at 02:52
  • 2
    [And you can refer to this](https://bugzilla.xamarin.com/show_bug.cgi?id=61073), try clean, rebuild, restart, delete the bin/obj in your project and rebuild. – Robbit Jan 16 '18 at 06:11
  • @JoeLv Thanks a lot for your help, but I followed the same exact steps but no luck. I think the problem is because I'm not using a PCL but the new .NET Standard so I have a warning on the reference for that. – amrswalha Jan 16 '18 at 07:51
  • Hi, `ClassNotFoundException` this exception maybe not your wrong, maybe it is complier's wrong,so have you tried this `clean, rebuild, restart, delete the bin/obj in your project and rebuild`? – Robbit Jan 16 '18 at 08:01
  • @JoeLv I've tried this and it did not work at all. – amrswalha Jan 16 '18 at 15:24
  • @JoeLv actually worked someway after doing what have you said so thanks a lot you have saved me :) – amrswalha Jan 17 '18 at 14:27
  • 1
    Aha, good luck! – Robbit Jan 17 '18 at 16:01

2 Answers2

1

It's better to follow the guide from the scratch, it seems that your error is not related to the Lottie package.

Here is the example for Xamarin.Forms: https://xamarinhelp.com/lottie-animations-xamarin-forms/

And here is how to build it with Xamarin.iOS and Xamarin.Android: https://blog.xamarin.com/bring-stunning-animations-to-your-apps-with-lottie/

Mando
  • 11,414
  • 17
  • 86
  • 167
0

There has been a bug in the latest versions of Lottie file. Try downgrading some versions back.

Nabil Akhlaque
  • 192
  • 1
  • 8