gpt4 book ai didi

android - Lottie.Forms 中不存在类型或命名空间 'Droid'

转载 作者:行者123 更新时间:2023-12-03 20:16:46 24 4
gpt4 key购买 nike

我在 Android 和 iOS 上使用 Xamarin.Forms。试图使 Lottie 动画工作,但支持 .NET Standard 2.0 的最新版本的 Lottie (2.5.4) 在 Android 项目中给出了构建错误:

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


查看 Lottie GitHub 源代码显示 namespace 和类在那里,所以我不确定为什么我的 Android 项目找不到引用。
我试过降级 Lottie,但到目前为止没有运气。包含引用的最早版本 (2.5.0) 不适用于 .NET Standard。
想法?

最佳答案

原来是 Xamarin.Forms Android 项目的目标框架版本存在问题。

最新版本的 Visual Studio 2017 使用 Android 7.1 目标框架创建新的 Xamarin.Forms Android 项目。

更改为 Android 8.1 修复了无法找到 Lottie.Forms.Droid 命名空间的编译器问题。

Android project settings

关于android - Lottie.Forms 中不存在类型或命名空间 'Droid',我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52185418/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com