xamarin / XamarinCommunityToolkit

The Xamarin Community Toolkit is a collection of Animations, Behaviors, Converters, and Effects for mobile development with Xamarin.Forms. It simplifies and demonstrates common developer tasks building iOS, Android, and UWP apps with Xamarin.Forms.
MIT License
1.58k stars 471 forks source link

[Bug] SafeAreaTypeConverter broken on iOS in Release mode - "Default constructor not found" #970

Open ederbond opened 3 years ago

ederbond commented 3 years ago

Description

When running on an iOS device in Release, the following exception is thrown: Default constructor not found for type Xamarin.CommunityToolkit.Helpers.SafeAreaTypeConverter This doesn't happen on the device in Debug, only Release.

Steps to Reproduce

Build and deploy to iPad in Release Navigate to screen with that uses SafeAreaTypeConverter Exception occurs on screen load

Stacktrace

Show/Hide StackTrace info ``` Autofac.Core.Resolving.Middleware ActivatorErrorHandlingMiddleware.Execute (Autofac.Core.Resolving.Pipeline.ResolveRequestContext context, System.Action`1[T] next) Autofac.Core.Resolving.Pipeline ResolvePipelineBuilder+<>c__DisplayClass14_0.b__1 (Autofac.Core.Resolving.Pipeline.ResolveRequestContext ctxt) Autofac.Core.Pipeline ResolvePipeline.Invoke (Autofac.Core.Resolving.Pipeline.ResolveRequestContext ctxt) Autofac.Core.Resolving.Middleware RegistrationPipelineInvokeMiddleware.Execute (Autofac.Core.Resolving.Pipeline.ResolveRequestContext context, System.Action`1[T] next) Autofac.Core.Resolving.Pipeline ResolvePipelineBuilder+<>c__DisplayClass14_0.b__1 (Autofac.Core.Resolving.Pipeline.ResolveRequestContext ctxt) Autofac.Core.Resolving.Middleware SharingMiddleware.Execute (Autofac.Core.Resolving.Pipeline.ResolveRequestContext context, System.Action`1[T] next) Autofac.Core.Resolving.Pipeline ResolvePipelineBuilder+<>c__DisplayClass14_0.b__1 (Autofac.Core.Resolving.Pipeline.ResolveRequestContext ctxt) Autofac.Core.Resolving.Middleware ScopeSelectionMiddleware.Execute (Autofac.Core.Resolving.Pipeline.ResolveRequestContext context, System.Action`1[T] next) Autofac.Core.Resolving.Pipeline ResolvePipelineBuilder+<>c__DisplayClass14_0.b__1 (Autofac.Core.Resolving.Pipeline.ResolveRequestContext ctxt) Autofac.Core.Resolving.Middleware CircularDependencyDetectorMiddleware.Execute (Autofac.Core.Resolving.Pipeline.ResolveRequestContext context, System.Action`1[T] next) Autofac.Core.Resolving.Pipeline ResolvePipelineBuilder+<>c__DisplayClass14_0.b__1 (Autofac.Core.Resolving.Pipeline.ResolveRequestContext ctxt) Autofac.Core.Pipeline ResolvePipeline.Invoke (Autofac.Core.Resolving.Pipeline.ResolveRequestContext ctxt) Autofac.Core.Resolving ResolveOperation.InvokePipeline (Autofac.ResolveRequest request, Autofac.Core.Resolving.Pipeline.DefaultResolveRequestContext requestContext) Autofac.Core.Resolving ResolveOperation.GetOrCreateInstance (Autofac.Core.ISharingLifetimeScope currentOperationScope, Autofac.ResolveRequest request) Autofac.Core.Resolving ResolveOperation.ExecuteOperation (Autofac.ResolveRequest request) Autofac.Core.Resolving ResolveOperation.Execute (Autofac.ResolveRequest request) Autofac.Core.Lifetime LifetimeScope.ResolveComponent (Autofac.ResolveRequest request) Autofac ResolutionExtensions.TryResolveService (Autofac.IComponentContext context, Autofac.Core.Service service, System.Collections.Generic.IEnumerable`1[T] parameters, System.Object& instance) Autofac ResolutionExtensions.ResolveService (Autofac.IComponentContext context, Autofac.Core.Service service, System.Collections.Generic.IEnumerable`1[T] parameters) Autofac ResolutionExtensions.Resolve (Autofac.IComponentContext context, System.Type serviceType, System.Collections.Generic.IEnumerable`1[T] parameters) Autofac ResolutionExtensions.Resolve (Autofac.IComponentContext context, System.Type serviceType) Hasc.Remote.Framework PageFactory.ResolvePage (System.Type viewModelType) ```

Expected Behavior

Actual Behavior

Basic Information

Show/Hide NuGet info ``` ```

Workaround

Setting this mtouch argument fixes the issue: --linkskip=Xamarin.CommunityToolkit

Here is the csproj of my XF shared project:

Show/Hide Shared csproj ``` netstandard2.1 *.xaml ToggleSelection.xaml ConfirmTraineeIdPhotoPage.xaml ScormCoursePlayerPage.xaml LoginPage.xaml CaptureTraineePhotoPage.xaml %(Filename) %(Filename) ConfirmTraineePhotoPage.xaml AuditPhotoPage.xaml ProctorPinPage.xaml %(Filename) ScormCoursePlayerPage.xaml RegistrationSelectCoursesPage.xaml FinalScorePage.xaml MSBuild:UpdateDesignTimeXaml MSBuild:UpdateDesignTimeXaml MSBuild:UpdateDesignTimeXaml MSBuild:UpdateDesignTimeXaml MSBuild:UpdateDesignTimeXaml MSBuild:UpdateDesignTimeXaml MSBuild:UpdateDesignTimeXaml MSBuild:UpdateDesignTimeXaml MSBuild:UpdateDesignTimeXaml MSBuild:UpdateDesignTimeXaml MSBuild:UpdateDesignTimeXaml MSBuild:Compile MSBuild:Compile MSBuild:Compile MSBuild:Compile MSBuild:Compile MSBuild:Compile ```

csproj of my iOS project

Show/Hide iOS csproj ``` Debug iPhoneSimulator 8.0.30703 2.0 {0D4BB52E-EFAB-427A-9090-D58165D8F4A0} {FEACFBD2-3405-455C-9665-78FE426C6842};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} Exe Hasc.RemoteTraining.iOS Resources Hasc.RemoteTraining.iOS true manual true full false bin\iPhoneSimulator\Debug DEBUG prompt 4 false x86_64 None true none true bin\iPhoneSimulator\Release prompt 4 None x86_64 false true full false bin\iPhone\Debug DEBUG prompt 4 false ARM64 iPhone Developer true None -all none true bin\iPhone\Release prompt 4 ARM64 false Apple Distribution: Houston Area Safety Council Inc (DWHSS66YJM) HASC Remote Training Testing Distribution true true --optimize=experimental-xforms-product-type none True bin\iPhone\Ad-Hoc prompt 4 False ARM64 True Automatic:AdHoc iPhone Distribution Entitlements.plist none True bin\iPhone\AppStore prompt 4 False ARM64 Automatic:AppStore iPhone Distribution Entitlements.plist Designer 6.1.0 4.1.0 4.1.0 1.0.6 7.8.0 2.0.0.10 1.60.0 1.60.0 2.80.2 1.7.335 5.0.0 5.0.0 4.5.4 1.6.1 2.4.1 2.4.1 8.4.3 1.0.3 1.4.2 false false false false false false false false false false false false false false false false false false false {698cc0ef-b7cc-4557-b9e6-cb172a02660a} Hasc.Remote ```
AndreiMisiukevich commented 3 years ago

Hi @ederbond Can you please attach a small sample with a reproduction of the crash?

pictos commented 3 years ago

@ederbond I couldn't see anything related to XCT on your stack-trace, so we will really need a repro to move this issue forward.