-
Notifications
You must be signed in to change notification settings - Fork 3
Description
When running the sample project on a physical Android device, I got this error:
`System.Reflection.TargetInvocationException: 'Exception has been thrown by the target of an invocation.'
[mono-rt] [ERROR] FATAL UNHANDLED EXCEPTION: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation.
[mono-rt] ---> System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation.
[mono-rt] ---> System.TypeInitializationException: The type initializer for 'RiveSharp.Factory' threw an exception.
[mono-rt] ---> System.DllNotFoundException: rive
[mono-rt] at RiveSharp.Factory..cctor() in D:\Projects\rive-maui\src\RiveSharp\Factory.cs:line 22
[mono-rt] --- End of inner exception stack trace ---
[mono-rt] at RiveSharp.Scene..ctor() in D:\Projects\rive-maui\src\RiveSharp\Scene.cs:line 28
[mono-rt] at RiveSharp.Views.RivePlayer..ctor() in D:\Projects\rive-maui\src\RiveSharp.Views.MAUI\RivePlayer.cs:line 169
[mono-rt] at System.Reflection.MethodBaseInvoker.InterpretedInvoke_Constructor(Object obj, IntPtr* args)
[mono-rt] at System.Reflection.MethodBaseInvoker.InvokeWithNoArgs(Object obj, BindingFlags invokeAttr)
[mono-rt] --- End of inner exception stack trace ---
[mono-rt] at System.Reflection.MethodBaseInvoker.InvokeWithNoArgs(Object obj, BindingFlags invokeAttr)
[mono-rt] at System.RuntimeType.CreateInstanceMono(Boolean nonPublic, Boolean wrapExceptions)
[mono-rt] at System.RuntimeType.CreateInstanceDefaultCtor(Boolean publicOnly, Boolean wrapExceptions)
[mono-rt] at System.Activator.CreateInstance(Type type, Boolean nonPublic, Boolean wrapExceptions)
[mono-rt] at System.Activator.CreateInstance(Type type, Boolean nonPublic)
[mono-rt] at System.Activator.CreateInstance(Type type)
[mono-rt] at Microsoft.Maui.Controls.Xaml.CreateValuesVisitor.Visit(ElementNode node, INode parentNode) in D:\a_work\1\s\src\Controls\src\Xaml\CreateValuesVisitor.cs:line 102
[mono-rt] at Microsoft.Maui.Controls.Xaml.ElementNode.Accept(IXamlNodeVisitor visitor, INode parentNode) in D:\a_work\1\s\src\Controls\src\Xaml\XamlNode.cs:line 159
[mono-rt] at Microsoft.Maui.Controls.Xaml.ElementNode.Accept(IXamlNodeVisitor visitor, INode parentNode) in D:\a_work\1\s\src\Controls\src\Xaml\XamlNode.cs:line 155
[mono-rt] at Microsoft.Maui.Controls.Xaml.RootNode.Accept(IXamlNodeVisitor visitor, INode parentNode) in D:\a_work\1\s\src\Controls\src\Xaml\XamlNode.cs:line 212
[mono-rt] at Microsoft.Maui.Controls.Xaml.XamlLoader.Visit(RootNode rootnode, HydrationContext visitorContext, Boolean useDesignProperties) in D:\a_work\1\s\src\Controls\src\Xaml\XamlLoader.cs:line 207
[mono-rt] at Microsoft.Maui.Controls.Xaml.XamlLoader.Load(Object view, String xaml, Assembly rootAssembly, Boolean useDesignProperties) in D:\a_work\1\s\src\Controls\src\Xaml\XamlLoader.cs:line 78
[mono-rt] at Microsoft.Maui.Controls.Xaml.XamlLoader.Load(Object view, String xaml, Boolean useDesignProperties) in D:\a_work\1\s\src\Controls\src\Xaml\XamlLoader.cs:line 53
[mono-rt] at Microsoft.Maui.Controls.Xaml.XamlLoader.Load(Object view, Type callingType) in D:\a_work\1\s\src\Controls\src\Xaml\XamlLoader.cs:line 49
[mono-rt] at Microsoft.Maui.Controls.Xaml.Extensions.LoadFromXaml[MainPage](MainPage view, Type callingType) in D:\a_work\1\s\src\Controls\src\Xaml\ViewExtensions.cs:line 37
[mono-rt] at Viewer.MainPage.InitializeComponent() in D:\Projects\rive-maui\src\Viewer\Microsoft.Maui.Controls.SourceGen\Microsoft.Maui.Controls.SourceGen.CodeBehindGenerator\MainPage.xaml.sg.cs:line 22
[mono-rt] at Viewer.MainPage..ctor() in D:\Projects\rive-maui\src\Viewer\MainPage.xaml.cs:line 7
[mono-rt] at System.Reflection.MethodBaseInvoker.InterpretedInvoke_Constructor(Object obj, IntPtr* args)
[mono-rt] at System.Reflection.MethodBaseInvoker.InvokeWithNoArgs(Object obj, BindingFlags invokeAttr)
[mono-rt] --- End of inner exception stack trace ---
[mono-rt] at System.Reflection.MethodBaseInvoker.InvokeWithNoArgs(Object obj, BindingFlags invokeAttr)
[mono-rt] at System.RuntimeType.CreateInstanceMono(Boolean nonPublic, Boolean wrapExceptions)
[mono-rt] at System.RuntimeType.CreateInstanceDefaultCtor(Boolean publicOnly, Boolean wrapExceptions)
[mono-rt] at System.Activator.CreateInstance(Type type, Boolean nonPublic, Boolean wrapExceptions)
[mono-rt] at System.Activator.CreateInstance(Type type, Boolean nonPublic)
[mono-rt] at System.Activator.CreateInstance(Type type)
[mono-rt] at Microsoft.Maui.Controls.ShellContent.<>c__DisplayClass19_0.<Microsoft.Maui.Controls.IShellContentController.GetOrCreateContent>b__0() in D:\a_work\1\s\src\Controls\src\Core\Shell\ShellContent.cs:line 76
[mono-rt] at Microsoft.Maui.Controls.ElementTemplate.CreateContent() in D:\a_work\1\s\src\Controls\src\Core\ElementTemplate.cs:line 86
[mono-rt] at Microsoft.Maui.Controls.Internals.DataTemplateExtensions.CreateContent(DataTemplate self, Object item, BindableObject container) in D:\a_work\1\s\src\Controls\src\Core\DataTemplateExtensions.cs:line 23
[mono-rt] at Microsoft.Maui.Controls.ShellContent.Microsoft.Maui.Controls.IShellContentController.GetOrCreateContent() in D:\a_work\1\s\src\Controls\src\Core\Shell\ShellContent.cs:line 81
[mono-rt] at Microsoft.Maui.Controls.Platform.Compatibility.ShellSectionRenderer.OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) in D:\a_work\1\s\src\Controls\src\Core\Compatibility\Handlers\Shell\Android\ShellSectionRenderer.cs:line 124
[mono-rt] at AndroidX.Fragment.App.Fragment.n_OnCreateView_Landroid_view_LayoutInflater_Landroid_view_ViewGroup_Landroid_os_Bundle_(IntPtr jnienv, IntPtr native__this, IntPtr native_inflater, IntPtr native_container, IntPtr native_savedInstanceState) in C:\a_work\1\s\generated\androidx.fragment.fragment\obj\Release
et6.0-android\generated\src\AndroidX.Fragment.App.Fragment.cs:line 2031
[mono-rt] at Android.Runtime.JNINativeWrapper.Wrap_JniMarshal_PPLLL_L(_JniMarshal_PPLLL_L callback, IntPtr jnienv, IntPtr klazz, IntPtr p0, IntPtr p1, IntPtr p2) in /Users/runner/work/1/s/xamarin-android/src/Mono.Android/Android.Runtime/JNINativeWrapper.g.cs:line 367`
Windows is running fine (after manualy copy the rive.dll to the AnyCPU folder (which I get an error on):