你好,我正在尝试运行xamarin表单与Lottie for Xamarin,但它崩溃了。我已经安装了Forms包和Droid包,并收到以下错误:
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]]此外,我还在MainActivity类中添加了以下代码:
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());
}
}
}并且我已经将.josn文件作为资产放置:

发布于 2018-12-08 10:48:12
最好从头开始遵循指南,看起来你的错误与Lottie包无关。
下面是Xamarin.Forms的示例:https://xamarinhelp.com/lottie-animations-xamarin-forms/
下面是如何使用Xamarin.iOS和Xamarin.Android构建它:https://blog.xamarin.com/bring-stunning-animations-to-your-apps-with-lottie/
发布于 2021-04-18 04:43:07
Lottie文件的最新版本中存在错误。尝试将一些版本降级。
https://stackoverflow.com/questions/48271109
复制相似问题