SkiaSharp.Extended icon indicating copy to clipboard operation
SkiaSharp.Extended copied to clipboard

Handler not found for view SkiaSharp.Extended.UI.Controls.SKLottieView

Open RajarajanA opened this issue 3 years ago • 11 comments

Description

SkiaSharpDemo sample code does not display LottiePage screen when it is selected in the mainpage list I have not received any error messages. When I opened LottiePage as the main page, I received a Handler not found error.

Code

Expected Behavior

The Lottie Page should display the lottie animation

Actual Behavior

It fails to display the Lottie page and fails with the exception Handler not found

Basic Information SkiaSharp demo code, same SDK configurations

Detailed IDE/OS information (click to expand)
Visual Studio Community 2022 for Mac Preview
Version 17.3 Preview (17.3 build 1972)
Installation UUID: 9a144d53-0b34-4ca8-8f6d-eeb4cf9531f8

Runtime
.NET 6.0.5 (64-bit)
Architecture: Arm64

Roslyn (Language Service)
4.3.0-3.22312.2+52adfb8b2dc71ed4278debcf13960f2116868608

NuGet
Version: 6.2.1.2

.NET SDK (Arm64)
SDK: /usr/local/share/dotnet/sdk/6.0.400-preview.22330.6/Sdks
SDK Versions:
	6.0.400-preview.22330.6
	6.0.301
MSBuild SDKs: /Applications/Visual Studio (Preview).app/Contents/MonoBundle/MSBuild/Current/bin/Sdks

.NET SDK (x64)
SDK Versions:
	3.1.421
	3.1.420

.NET Runtime (Arm64)
Runtime: /usr/local/share/dotnet/dotnet
Runtime Version: 6.0.6

.NET Runtime (x64)
Runtime: /usr/local/share/dotnet/x64/dotnet
Runtime Versions:
	3.1.27
	3.1.26

Xamarin.Profiler
Version: 1.8.0.19
Location: /Applications/Xamarin Profiler.app/Contents/MacOS/Xamarin Profiler

Updater
Version: 11

Xamarin.Android
Version: 13.0.0.0 (Visual Studio Community)
Commit: xamarin-android/d17-3/030cd63
Android SDK: /Users/rajarajan/Library/Developer/Xamarin/android-sdk-macosx
	Supported Android versions:
		12.0 (API level 31)
		11.0 (API level 30)
		10.0 (API level 29)

SDK Command-line Tools Version: 7.0
SDK Platform Tools Version: 33.0.2
SDK Build Tools Version: 33.0.0

Build Information: 
Mono: dffa5ab
Java.Interop: xamarin/java.interop/d17-3@7716ae53
SQLite: xamarin/sqlite/3.38.5@df4deab
Xamarin.Android Tools: xamarin/xamarin-android-tools/main@14076a6

Microsoft Build of OpenJDK
Java SDK: /Library/Java/JavaVirtualMachines/microsoft-11.jdk
11.0.12
Android Designer EPL code available here:
https://github.com/xamarin/AndroidDesigner.EPL

Eclipse Temurin JDK
Java SDK: /Library/Java/JavaVirtualMachines/temurin-8.jdk
1.8.0.302
Android Designer EPL code available here:
https://github.com/xamarin/AndroidDesigner.EPL

Android SDK Manager
Version: 17.3.0.18
Hash: 59267e9
Branch: remotes/origin/main
Build date: 2022-07-12 19:11:27 UTC

Android Device Manager
Version: 0.0.0.1163
Hash: 3f16765
Branch: main
Build date: 2022-07-12 19:11:27 UTC

Xamarin Designer
Version: 17.3.0.201
Hash: 94069a36b
Branch: remotes/origin/d17-3
Build date: 2022-07-12 19:11:23 UTC

Apple Developer Tools
Xcode 13.4.1 (20504)
Build 13F100

Xamarin.Mac
Version: 8.10.0.5 (Visual Studio Community)
Hash: 96b3edb6d
Branch: d17-2
Build date: 2022-05-18 07:32:06-0400

Xamarin.iOS
Version: 15.10.0.5 (Visual Studio Community)
Hash: 96b3edb6d
Branch: d17-2
Build date: 2022-05-18 07:32:07-0400

Build Information
Release ID: 1703001972
Git revision: 8eb3c1bb0f14a8e54ee7c227c7047c46cff6ee8c
Build date: 2022-07-12 19:09:28+00
Build branch: release-17.3
Build lane: release-17.3

Operating System
Mac OS X 12.4.0
Darwin 21.5.0 Darwin Kernel Version 21.5.0
    Tue Apr 26 21:08:29 PDT 2022
    root:xnu-8020.121.3~4/RELEASE_ARM64_T8101 arm64

Screenshots

Reproduction Link

** Error message **

Handler not found for view SkiaSharp.Extended.UI.Controls.SKLottieView.

   at Microsoft.Maui.Platform.ElementExtensions.ToHandler(IElement view, IMauiContext context)
   at Microsoft.Maui.Platform.ElementExtensions.ToPlatform(IElement view, IMauiContext context)
   at Microsoft.Maui.Handlers.LayoutHandler.SetVirtualView(IView view)
   at Microsoft.Maui.Handlers.ViewHandler`2[[Microsoft.Maui.ILayout, Microsoft.Maui, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null],[Microsoft.Maui.Platform.LayoutView, Microsoft.Maui, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]].SetVirtualView(IElement view)
   at Microsoft.Maui.Controls.Element.SetHandler(IElementHandler newHandler)
   at Microsoft.Maui.Controls.Element.set_Handler(IElementHandler value)
   at Microsoft.Maui.Controls.VisualElement.Microsoft.Maui.IElement.set_Handler(IElementHandler value)
   at Microsoft.Maui.Platform.ElementExtensions.ToHandler(IElement view, IMauiContext context)
   at Microsoft.Maui.Platform.ElementExtensions.ToPlatform(IElement view, IMauiContext context)
   at Microsoft.Maui.Handlers.ContentViewHandler.UpdateContent(IContentViewHandler handler)
   at Microsoft.Maui.Handlers.ContentViewHandler.MapContent(IContentViewHandler handler, IContentView page)
   at Microsoft.Maui.PropertyMapper`2.<>c__DisplayClass5_0[[Microsoft.Maui.IContentView, Microsoft.Maui, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null],[Microsoft.Maui.Handlers.IContentViewHandler, Microsoft.Maui, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]].<Add>b__0(IElementHandler h, IElement v)
   at Microsoft.Maui.PropertyMapper.UpdatePropertyCore(String key, IElementHandler viewHandler, IElement virtualView)
   at Microsoft.Maui.PropertyMapper.UpdateProperties(IElementHandler viewHandler, IElement virtualView)
   at Microsoft.Maui.Handlers.ElementHandler.SetVirtualView(IElement view)
   at Microsoft.Maui.Handlers.ViewHandler`2[[Microsoft.Maui.IContentView, Microsoft.Maui, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null],[Microsoft.Maui.Platform.ContentView, Microsoft.Maui, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]].SetVirtualView(IView view)
   at Microsoft.Maui.Handlers.ContentViewHandler.SetVirtualView(IView view)
   at Microsoft.Maui.Handlers.ViewHandler`2[[Microsoft.Maui.IContentView, Microsoft.Maui, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null],[Microsoft.Maui.Platform.ContentView, Microsoft.Maui, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]].SetVirtualView(IElement view)
   at Microsoft.Maui.Controls.Element.SetHandler(IElementHandler newHandler)
   at Microsoft.Maui.Controls.Element.set_Handler(IElementHandler value)
   at Microsoft.Maui.Controls.VisualElement.Microsoft.Maui.IElement.set_Handler(IElementHandler value)
   at Microsoft.Maui.Platform.ElementExtensions.ToHandler(IElement view, IMauiContext context)
   at Microsoft.Maui.Platform.ViewExtensions.ToHandler(IView view, IMauiContext context)
   at Microsoft.Maui.Controls.Platform.Compatibility.ShellSectionRootRenderer.SetPageRenderer(Page page, ShellContent shellContent)
   at Microsoft.Maui.Controls.Platform.Compatibility.ShellSectionRootRenderer.LoadRenderers()
   at Microsoft.Maui.Controls.Platform.Compatibility.ShellSectionRootRenderer.ViewDidLoad()
   at UIKit.UIApplication.Main(String[] args, Type principalClass, Type delegateClass)
   at SkiaSharpDemo.Program.Main(String[] args) in /Users/<UserName>/OnlineCodes/SkiaSharp.Extended/samples/Maui/SkiaSharpDemo/Platforms/MacCatalyst/Program.cs:line 13

RajarajanA avatar Jul 17 '22 01:07 RajarajanA

I've seen this too, but on Windows it works fine. Seems specific to building on a Mac.

.UseSkiaSharp() is in place, building on Windows and deploy to Android: works. Build the same code on Mac and deploy to iOS, macOS, Android: doesn't work and throws this error.

jfversluis avatar Jul 17 '22 14:07 jfversluis

Thanks for the additional info about platforms. I'll have a look.

mattleibow avatar Jul 28 '22 01:07 mattleibow

Having the same problem (Handler not found) on Mac notwithstanding including .UseSkiaSharp() in Builder.

rsbepvb avatar Jul 31 '22 14:07 rsbepvb

Seems like this might've been a bug in... something else. It's working for me now from a Mac as well!

jfversluis avatar Aug 21 '22 18:08 jfversluis

Thanks Gerald, but I just checked again on my Mac and it still throws this Handler not found for SKLottieView exception. Running latest versions of everything (VSM 17.4 preview, all dependencies updated, etc..).

rsbepvb avatar Aug 21 '22 18:08 rsbepvb

Did you add .UseSkiaSharp() in your builder?

mattleibow avatar Aug 22 '22 09:08 mattleibow

+1 Issue still exist. Latest Visual studio MAC and Latest .Net MAUI 6.0.486

samirgcofficial avatar Sep 02 '22 05:09 samirgcofficial

Confirming that the issue is still persisting for us. Yes, added .UseSkiaSharp() in builder.

rsbepvb avatar Sep 02 '22 22:09 rsbepvb

Are you able to attach a repro of this and share the output of dotnet --info and dotnet workload list?

mattleibow avatar Sep 03 '22 04:09 mattleibow

Microsoft.Maui.Platform.HandlerNotFoundException: 'Handler not found for view SkiaSharp.Extended.UI.Controls.SKLottieView.'

is that problem fixed?

I ran it in Visual Studio 2022 preview version(win10) with .net 6.

dennischchch avatar Nov 07 '22 07:11 dennischchch

Can you try the latest preview versions? I think I fixed it.

mattleibow avatar Sep 01 '23 18:09 mattleibow

Closing this issue as I think I fixed the issue. Please open a new issue with a repro if it is still happening.

mattleibow avatar Apr 08 '24 09:04 mattleibow