-
Notifications
You must be signed in to change notification settings - Fork 454
[Bug] Converter Types are not found when defined only in seperate ResourceDictionary file when LinkerBehavior is Link Framework SDKs #1869
Description
Description
When declaring a resource of a converter type only in a seperate ResourceDictionary file while LinkerBehavior is set to 'Link Framework SDKs only', then application crashes saying ' not found in http://xamarin.com/schemas/2020/toolkit'.
Stack Trace
Unhandled Exception:
Xamarin.Forms.Xaml.XamlParseException: Position 5:14. Type converters:EqualConverter not found in xmlns http://xamarin.com/schemas/2020/toolkit
at Xamarin.Forms.Xaml.CreateValuesVisitor.Visit (Xamarin.Forms.Xaml.ElementNode node, Xamarin.Forms.Xaml.INode parentNode) [0x0005f] in D:\a_work\1\s\Xamarin.Forms.Xaml\CreateValuesVisitor.cs:55
at Xamarin.Forms.Xaml.ElementNode.Accept (Xamarin.Forms.Xaml.IXamlNodeVisitor visitor, Xamarin.Forms.Xaml.INode parentNode) [0x000ac] in D:\a_work\1\s\Xamarin.Forms.Xaml\XamlNode.cs:158
at Xamarin.Forms.Xaml.ElementNode.Accept (Xamarin.Forms.Xaml.IXamlNodeVisitor visitor, Xamarin.Forms.Xaml.INode parentNode) [0x00079] in D:\a_work\1\s\Xamarin.Forms.Xaml\XamlNode.cs:154
at Xamarin.Forms.Xaml.RootNode.Accept (Xamarin.Forms.Xaml.IXamlNodeVisitor visitor, Xamarin.Forms.Xaml.INode parentNode) [0x00079] in D:\a_work\1\s\Xamarin.Forms.Xaml\XamlNode.cs:211
at Xamarin.Forms.Xaml.XamlLoader.Visit (Xamarin.Forms.Xaml.RootNode rootnode, Xamarin.Forms.Xaml.HydrationContext visitorContext, System.Boolean useDesignProperties) [0x00064] in D:\a_work\1\s\Xamarin.Forms.Xaml\XamlLoader.cs:233
at Xamarin.Forms.Xaml.XamlLoader.Load (System.Object view, System.String xaml, System.Reflection.Assembly rootAssembly, System.Boolean useDesignProperties) [0x000a2] in D:\a_work\1\s\Xamarin.Forms.Xaml\XamlLoader.cs:104
at Xamarin.Forms.Xaml.XamlLoader.Load (System.Object view, System.String xaml, System.Reflection.Assembly rootAssembly) [0x00000] in D:\a_work\1\s\Xamarin.Forms.Xaml\XamlLoader.cs:78
at Xamarin.Forms.Xaml.Extensions.LoadFromXaml[TXaml] (TXaml view, System.String xaml, System.Reflection.Assembly rootAssembly) [0x00000] in D:\a_work\1\s\Xamarin.Forms.Xaml\ViewExtensions.cs:49
at Xamarin.Forms.Xaml.ResourcesLoader.CreateFromResource[T] (System.String resourcePath, System.Reflection.Assembly assembly, System.Xml.IXmlLineInfo lineInfo) [0x000b1] in D:\a_work\1\s\Xamarin.Forms.Xaml\ResourcesLoader.cs:39
at Xamarin.Forms.ResourceDictionary.SetAndLoadSource (System.Uri value, System.String resourcePath, System.Reflection.Assembly assembly, System.Xml.IXmlLineInfo lineInfo) [0x00063] in D:\a_work\1\s\Xamarin.Forms.Core\ResourceDictionary.cs:76
at MultiConverterIssue.MainPage.InitializeComponent () [0x00012] in /Users/flaviogoncalves/RiderProjects/MultiConverterIssue/MultiConverterIssue/MultiConverterIssue/obj/Debug/netstandard2.0/MainPage.xaml.g.cs:22
at MultiConverterIssue.MainPage..ctor () [0x00008] in /Users/flaviogoncalves/RiderProjects/MultiConverterIssue/MultiConverterIssue/MultiConverterIssue/MainPage.xaml.cs:14
at MultiConverterIssue.App..ctor () [0x0000f] in /Users/flaviogoncalves/RiderProjects/MultiConverterIssue/MultiConverterIssue/MultiConverterIssue/App.xaml.cs:15
at MultiConverterIssue.iOS.AppDelegate.FinishedLaunching (UIKit.UIApplication app, Foundation.NSDictionary options) [0x00007] in /Users/flaviogoncalves/RiderProjects/MultiConverterIssue/MultiConverterIssue/MultiConverterIssue.iOS/AppDelegate.cs:25
at (wrapper managed-to-native) UIKit.UIApplication.UIApplicationMain(int,string[],intptr,intptr)
at UIKit.UIApplication.Main (System.String[] args, System.String principalClassName, System.String delegateClassName) [0x00013] in /Users/builder/azdo/_work/1/s/xamarin-macios/src/UIKit/UIApplication.cs:75
at MultiConverterIssue.iOS.Application.Main (System.String[] args) [0x00001] in /Users/flaviogoncalves/RiderProjects/MultiConverterIssue/MultiConverterIssue/MultiConverterIssue.iOS/Main.cs:16
2022-06-02 08:49:34.947864+0200 MultiConverterIssue.iOS[5364:86263] Unhandled managed exception: Position 5:14. Type converters:EqualConverter not found in xmlns http://xamarin.com/schemas/2020/toolkit (Xamarin.Forms.Xaml.XamlParseException)
at Xamarin.Forms.Xaml.CreateValuesVisitor.Visit (Xamarin.Forms.Xaml.ElementNode node, Xamarin.Forms.Xaml.INode parentNode) [0x0005f] in D:\a_work\1\s\Xamarin.Forms.Xaml\CreateValuesVisitor.cs:55
at Xamarin.Forms.Xaml.ElementNode.Accept (Xamarin.Forms.Xaml.IXamlNodeVisitor visitor, Xamarin.Forms.Xaml.INode parentNode) [0x000ac] in D:\a_work\1\s\Xamarin.Forms.Xaml\XamlNode.cs:158
at Xamarin.Forms.Xaml.ElementNode.Accept (Xamarin.Forms.Xaml.IXamlNodeVisitor visitor, Xamarin.Forms.Xaml.INode parentNode) [0x00079] in D:\a_work\1\s\Xamarin.Forms.Xaml\XamlNode.cs:154
at Xamarin.Forms.Xaml.RootNode.Accept (Xamarin.Forms.Xaml.IXamlNodeVisitor visitor, Xamarin.Forms.Xaml.INode parentNode) [0x00079] in D:\a_work\1\s\Xamarin.Forms.Xaml\XamlNode.cs:211
at Xamarin.Forms.Xaml.XamlLoader.Visit (Xamarin.Forms.Xaml.RootNode rootnode, Xamarin.Forms.Xaml.HydrationContext visitorContext, System.Boolean useDesignProperties) [0x00064] in D:\a_work\1\s\Xamarin.Forms.Xaml\XamlLoader.cs:233
at Xamarin.Forms.Xaml.XamlLoader.Load (System.Object view, System.String xaml, System.Reflection.Assembly rootAssembly, System.Boolean useDesignProperties) [0x000a2] in D:\a_work\1\s\Xamarin.Forms.Xaml\XamlLoader.cs:104
at Xamarin.Forms.Xaml.XamlLoader.Load (System.Object view, System.String xaml, System.Reflection.Assembly rootAssembly) [0x00000] in D:\a_work\1\s\Xamarin.Forms.Xaml\XamlLoader.cs:78
at Xamarin.Forms.Xaml.Extensions.LoadFromXaml[TXaml] (TXaml view, System.String xaml, System.Reflection.Assembly rootAssembly) [0x00000] in D:\a_work\1\s\Xamarin.Forms.Xaml\ViewExtensions.cs:49
at Xamarin.Forms.Xaml.ResourcesLoader.CreateFromResource[T] (System.String resourcePath, System.Reflection.Assembly assembly, System.Xml.IXmlLineInfo lineInfo) [0x000b1] in D:\a_work\1\s\Xamarin.Forms.Xaml\ResourcesLoader.cs:39
at Xamarin.Forms.ResourceDictionary.SetAndLoadSource (System.Uri value, System.String resourcePath, System.Reflection.Assembly assembly, System.Xml.IXmlLineInfo lineInfo) [0x00063] in D:\a_work\1\s\Xamarin.Forms.Core\ResourceDictionary.cs:76
at MultiConverterIssue.MainPage.InitializeComponent () [0x00012] in /Users/flaviogoncalves/RiderProjects/MultiConverterIssue/MultiConverterIssue/MultiConverterIssue/obj/Debug/netstandard2.0/MainPage.xaml.g.cs:22
at MultiConverterIssue.MainPage..ctor () [0x00008] in /Users/flaviogoncalves/RiderProjects/MultiConverterIssue/MultiConverterIssue/MultiConverterIssue/MainPage.xaml.cs:14
at MultiConverterIssue.App..ctor () [0x0000f] in /Users/flaviogoncalves/RiderProjects/MultiConverterIssue/MultiConverterIssue/MultiConverterIssue/App.xaml.cs:15
at MultiConverterIssue.iOS.AppDelegate.FinishedLaunching (UIKit.UIApplication app, Foundation.NSDictionary options) [0x00007] in /Users/flaviogoncalves/RiderProjects/MultiConverterIssue/MultiConverterIssue/MultiConverterIssue.iOS/AppDelegate.cs:25
at (wrapper managed-to-native) UIKit.UIApplication.UIApplicationMain(int,string[],intptr,intptr)
at UIKit.UIApplication.Main (System.String[] args, System.String principalClassName, System.String delegateClassName) [0x00013] in /Users/builder/azdo/_work/1/s/xamarin-macios/src/UIKit/UIApplication.cs:75
at MultiConverterIssue.iOS.Application.Main (System.String[] args) [0x00001] in /Users/flaviogoncalves/RiderProjects/MultiConverterIssue/MultiConverterIssue/MultiConverterIssue.iOS/Main.cs:16
=================================================================
Native Crash Reporting
Got a abrt while executing native code. This usually indicates
a fatal error in the mono runtime or one of the native libraries
used by your application.
=================================================================
Native stacktrace:
0x1043aa1c5 - /Users/flaviogoncalves/Library/Developer/CoreSimulator/Devices/470341FB-8D36-4691-8FD0-C708B5633572/data/Containers/Bundle/Application/CD104B5A-A251-46C4-938B-7A975C458BDB/MultiConverterIssue.iOS.app/MultiConverterIssue.iOS : mono_dump_native_crash_info
0x10439ec9e - /Users/flaviogoncalves/Library/Developer/CoreSimulator/Devices/470341FB-8D36-4691-8FD0-C708B5633572/data/Containers/Bundle/Application/CD104B5A-A251-46C4-938B-7A975C458BDB/MultiConverterIssue.iOS.app/MultiConverterIssue.iOS : mono_handle_native_crash
0x1043a97ff - /Users/flaviogoncalves/Library/Developer/CoreSimulator/Devices/470341FB-8D36-4691-8FD0-C708B5633572/data/Containers/Bundle/Application/CD104B5A-A251-46C4-938B-7A975C458BDB/MultiConverterIssue.iOS.app/MultiConverterIssue.iOS : sigabrt_signal_handler
0x112f30e2d - /usr/lib/system/libsystem_platform.dylib : _sigtramp
0x112e33000 - /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/usr/lib/system/libsystem_malloc.dylib : virtual_default_zone
0x112ef66b7 - /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/usr/lib/system/libsystem_c.dylib : abort
0x10459b6c7 - /Users/flaviogoncalves/Library/Developer/CoreSimulator/Devices/470341FB-8D36-4691-8FD0-C708B5633572/data/Containers/Bundle/Application/CD104B5A-A251-46C4-938B-7A975C458BDB/MultiConverterIssue.iOS.app/MultiConverterIssue.iOS : xamarin_unhandled_exception_handler
0x104459335 - /Users/flaviogoncalves/Library/Developer/CoreSimulator/Devices/470341FB-8D36-4691-8FD0-C708B5633572/data/Containers/Bundle/Application/CD104B5A-A251-46C4-938B-7A975C458BDB/MultiConverterIssue.iOS.app/MultiConverterIssue.iOS : mono_invoke_unhandled_exception_hook
0x10439e8b3 - /Users/flaviogoncalves/Library/Developer/CoreSimulator/Devices/470341FB-8D36-4691-8FD0-C708B5633572/data/Containers/Bundle/Application/CD104B5A-A251-46C4-938B-7A975C458BDB/MultiConverterIssue.iOS.app/MultiConverterIssue.iOS : mono_handle_exception_internal
0x10439cdd9 - /Users/flaviogoncalves/Library/Developer/CoreSimulator/Devices/470341FB-8D36-4691-8FD0-C708B5633572/data/Containers/Bundle/Application/CD104B5A-A251-46C4-938B-7A975C458BDB/MultiConverterIssue.iOS.app/MultiConverterIssue.iOS : mono_handle_exception
0x10431f1f0 - /Users/flaviogoncalves/Library/Developer/CoreSimulator/Devices/470341FB-8D36-4691-8FD0-C708B5633572/data/Containers/Bundle/Application/CD104B5A-A251-46C4-938B-7A975C458BDB/MultiConverterIssue.iOS.app/MultiConverterIssue.iOS : mono_amd64_throw_exception
0x12f63e5b0 - Unknown
0x13caa9a08 - Unknown
0x13caa9813 - Unknown
0x13caa7f63 - Unknown
0x13caa751d - Unknown
=================================================================
Basic Fault Address Reporting
Memory around native instruction pointer (0x114bfe112):0x114bfe102 ff ff c3 90 90 90 b8 48 01 00 02 49 89 ca 0f 05 .......H...I....
0x114bfe112 73 08 48 89 c7 e9 d5 a1 ff ff c3 90 90 90 b8 53 s.H............S
0x114bfe122 00 00 02 49 89 ca 0f 05 73 08 48 89 c7 e9 bd a1 ...I....s.H.....
0x114bfe132 ff ff c3 90 90 90 b8 83 01 00 02 49 89 ca 0f 05 ...........I....
=================================================================
Managed Stacktrace:
=================================================================
Link to Reproduction Sample
https://github.com/F-Goncalves/XCT.MultiConverterIssueRepro
Steps to Reproduce
- Run iOS or Android Project
- App crashes with above Exception
Expected Behavior
No crashes
Actual Behavior
Crashes
Basic Information
- Version with issue: 2.0.2
- Last known good version: ?
- IDE: JetBrains Rider
- Platform Target Frameworks:
- iOS: 15.0
- Android: 12.0
Workaround
Do not have seperate file for XCT resources