Skiasharp: [BUG] Tizen Xamarin.Forms.Init error

Created on 24 Jan 2020  路  9Comments  路  Source: mono/SkiaSharp

System.TypeLoadException: Method 'LoadImageAsync' in type 'SkiaSharp.Views.Forms.SKImageSourceHandler' from assembly 'SkiaSharp.Views.Forms, Version=1.68.0.0, Culture=neutral, PublicKeyToken=null' does not have an implementation.
   at System.Reflection.CustomAttribute._CreateCaObject(RuntimeModule pModule, RuntimeType type, IRuntimeMethodInfo pCtor, Byte** ppBlob, Byte pcNamedArgs)
   at System.Reflection.CustomAttribute.CreateCaObject(RuntimeModule module, RuntimeType type, IRuntimeMethodInfo ctor, IntPtr& blob, IntPtr blobEnd, Int32& namedArgs)
   at System.Reflection.CustomAttribute.AddCustomAttributes(ListBuilder1& attributes, RuntimeModule decoratedModule, Int32 decoratedMetadataToken, RuntimeType attributeFilterType, Boolean mustBeInheritable, ListBuilder1 derivedAttributes)
   at System.Reflection.CustomAttribute.GetCustomAttributes(RuntimeModule decoratedModule, Int32 decoratedMetadataToken, Int32 pcaCount, RuntimeType attributeFilterType)
   at System.Reflection.CustomAttribute.GetCustomAttributes(RuntimeAssembly assembly, RuntimeType caType)
   at System.Reflection.RuntimeAssembly.GetCustomAttributes(Type attributeType, Boolean inherit)
   at Xamarin.Forms.Internals.ReflectionExtensions.GetCustomAttributesSafe(Assembly assembly, Type attrType)
   at Xamarin.Forms.Internals.Registrar.RegisterAll(Type[] attrTypes, InitializationFlags flags)
   at Xamarin.Forms.Internals.Registrar.RegisterAll(Type[] attrTypes)
   at Xamarin.Forms.Forms.SetupInit(CoreApplication application, InitializationOptions options)
   at Xamarin.Forms.Forms.Init(CoreApplication application, Boolean useDeviceIndependentPixel)

latest nightly build XF
latest preview SkiaSharp

type-bug

Most helpful comment

with preview.39 I receive the same error, but on app.Run(args)

System.TypeLoadException: Method 'LoadImageAsync' in type 'SkiaSharp.Views.Forms.SKImageSourceHandler' from assembly 'SkiaSharp.Views.Forms, Version=1.68.0.0, Culture=neutral, PublicKeyToken=null' does not have an implementation.
   at System.Reflection.CustomAttribute._CreateCaObject(RuntimeModule pModule, RuntimeType type, IRuntimeMethodInfo pCtor, Byte** ppBlob, Byte pcNamedArgs)
   at System.Reflection.CustomAttribute.CreateCaObject(RuntimeModule module, RuntimeType type, IRuntimeMethodInfo ctor, IntPtr& blob, IntPtr blobEnd, Int32& namedArgs)
   at System.Reflection.CustomAttribute.AddCustomAttributes(ListBuilder1& attributes, RuntimeModule decoratedModule, Int32 decoratedMetadataToken, RuntimeType attributeFilterType, Boolean mustBeInheritable, ListBuilder1 derivedAttributes)
   at System.Reflection.CustomAttribute.GetCustomAttributes(RuntimeModule decoratedModule, Int32 decoratedMetadataToken, Int32 pcaCount, RuntimeType attributeFilterType)
   at System.Reflection.CustomAttribute.GetCustomAttributes(RuntimeAssembly assembly, RuntimeType caType)
   at System.Reflection.RuntimeAssembly.GetCustomAttributes(Type attributeType, Boolean inherit)
   at Xamarin.Forms.Internals.ReflectionExtensions.GetCustomAttributesSafe(Assembly assembly, Type attrType)
   at Xamarin.Forms.Internals.Registrar.RegisterAll(Type[] attrTypes, InitializationFlags flags)
   at Xamarin.Forms.Forms.SetupInit(CoreApplication application, InitializationOptions options)
   at Xamarin.Forms.Forms.Init(CoreApplication application, Boolean useDeviceIndependentPixel)

All 9 comments

Thanks for reporting this. It appears that Tizen has changed some things in Forms. I got a fix.

So I just pushed a potential fix (#1117) to the preview feed: https://aka.ms/skiasharp-eap/index.json
The version is: 1.68.2-pr.1117.1

Let me know it that works - I can't test right now as I am having issues with the Tizen emulators, and my device got bust somehow. If it works, then we can merge. And, when 4.4 is more than a month old and people can update, then we can move permanently.

@mattleibow I still see the issue:
image

Pity. I guess we are going to have to just use the latest forms. Not too bad I suppose.

I would appreciate if you publish a potential fix before merging to the master, so I could give a fast feedback

Oh, will do. It is building as we speak!

Still having a look at this. The fix is easy, but UWP and CI aren't happy. Seems to be some issue with PDB files or something....

with preview.39 I receive the same error, but on app.Run(args)

System.TypeLoadException: Method 'LoadImageAsync' in type 'SkiaSharp.Views.Forms.SKImageSourceHandler' from assembly 'SkiaSharp.Views.Forms, Version=1.68.0.0, Culture=neutral, PublicKeyToken=null' does not have an implementation.
   at System.Reflection.CustomAttribute._CreateCaObject(RuntimeModule pModule, RuntimeType type, IRuntimeMethodInfo pCtor, Byte** ppBlob, Byte pcNamedArgs)
   at System.Reflection.CustomAttribute.CreateCaObject(RuntimeModule module, RuntimeType type, IRuntimeMethodInfo ctor, IntPtr& blob, IntPtr blobEnd, Int32& namedArgs)
   at System.Reflection.CustomAttribute.AddCustomAttributes(ListBuilder1& attributes, RuntimeModule decoratedModule, Int32 decoratedMetadataToken, RuntimeType attributeFilterType, Boolean mustBeInheritable, ListBuilder1 derivedAttributes)
   at System.Reflection.CustomAttribute.GetCustomAttributes(RuntimeModule decoratedModule, Int32 decoratedMetadataToken, Int32 pcaCount, RuntimeType attributeFilterType)
   at System.Reflection.CustomAttribute.GetCustomAttributes(RuntimeAssembly assembly, RuntimeType caType)
   at System.Reflection.RuntimeAssembly.GetCustomAttributes(Type attributeType, Boolean inherit)
   at Xamarin.Forms.Internals.ReflectionExtensions.GetCustomAttributesSafe(Assembly assembly, Type attrType)
   at Xamarin.Forms.Internals.Registrar.RegisterAll(Type[] attrTypes, InitializationFlags flags)
   at Xamarin.Forms.Forms.SetupInit(CoreApplication application, InitializationOptions options)
   at Xamarin.Forms.Forms.Init(CoreApplication application, Boolean useDeviceIndependentPixel)

Thank you for reporting the issue. As @mattleibow mentioned above, there are small changes (#8905) on XF.Tizen backend. I think updating Xamarin.Forms version to 4.5.0 or higher will solve this. Sorry for inconvenience. 馃檹

_update_
It seems #1117 can fix this issue. And, #1167 is also same issue.

Was this page helpful?
0 / 5 - 0 ratings