Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/xamarin/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/blackberry/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Xamarin 乐透错误:“乐透”;Java.Lang.IllegalStateException:';无法分析组合'&引用;_Xamarin_Xamarin.forms_Visual Studio 2019 - Fatal编程技术网

Xamarin 乐透错误:“乐透”;Java.Lang.IllegalStateException:';无法分析组合'&引用;

Xamarin 乐透错误:“乐透”;Java.Lang.IllegalStateException:';无法分析组合'&引用;,xamarin,xamarin.forms,visual-studio-2019,Xamarin,Xamarin.forms,Visual Studio 2019,当我尝试将gif加载到我的项目时,突然返回错误: Java.Lang.IllegalStateException: 'Unable to parse composition' 有关详细信息,请参阅图片 我想在我的项目中插入gif,我尝试使用Lottie和Json文件 到目前为止我的代码 <forms:AnimationView x:Name="animationView" Grid.Row="1" Animation="first.json" Loo

当我尝试将gif加载到我的项目时,突然返回错误:

Java.Lang.IllegalStateException: 'Unable to parse composition'
有关详细信息,请参阅图片

我想在我的项目中插入gif,我尝试使用Lottie和Json文件

到目前为止我的代码

<forms:AnimationView 
    x:Name="animationView" 
    Grid.Row="1"
    Animation="first.json" 
    Loop="false" 
    AutoPlay="false"/>

请将
xmlns:lottie=“clr命名空间:lottie.Forms;assembly=lottie.Forms”
添加到XAML头部并使用此组件

 <lottie:AnimationView 
                x:Name="AnimationView" 
                Animation="first.json" 
                AutoPlay="True" Loop="true"
                VerticalOptions="FillAndExpand"
                HorizontalOptions="FillAndExpand" />


别忘了初始化AnimationViewRenderer.init()需要确定类似json的

               at 
        com.airbnb.lottie.LottieAnimationView$2.onResult(LottieAnimationView.java:75)
               at 
        com.airbnb.lottie.LottieAnimationView$2.onResult(LottieAnimationView.java:73)
               at 
        com.airbnb.lottie.LottieTask.notifyFailureListeners(LottieTask.java:158)
               at com.airbnb.lottie.LottieTask.access$200(LottieTask.java:27)
               at com.airbnb.lottie.LottieTask$1.run(LottieTask.java:133)
               at android.os.Handler.handleCallback(Handler.java:836)
               at android.os.Handler.dispatchMessage(Handler.java:103)
               at android.os.Looper.loop(Looper.java:232)
               at android.app.ActivityThread.main(ActivityThread.java:6802)
               at java.lang.reflect.Method.invoke(Method.java)
               at 
       com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1103)
               at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:964)```

’
I also encountered the same problem, but I couldn't find the AnimationViewRenderer class in my code to initialize it
Android:
DroidProject/Assets/filename.json
类似于AndroidAsset


iOS:
iOSProject/filename.json
就像BundleResource一样

在我的例子中,我用
app:lottie\u url
替换了
app:lottie\u rawRes
,效果很好

我做了,但同样的错误。其中必须是assest文件夹中的first.json或?@HristoIvanov json文件必须在android的资产和IOS的资源中是的,我做了,但相同的错误确定感谢修复粘贴“AnimationViewRenderer.Init()”在错误的位置再次感谢advice@HristoIvanov请尝试放置AnimationViewRenderer.Init();低于base.OnCreate(savedInstanceState);如果这是对本页顶部问题的回答,那么需要对其进行修改,使有帮助的回答部分更加明显。