Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Xamarin.iOS] DryIocTypeResolver.Resolve (System.Type type) SIGABRT: Operation is not supported on this platform. #532

Open
JustickDM opened this issue Oct 19, 2022 · 6 comments
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@JustickDM
Copy link

JustickDM commented Oct 19, 2022

DryIoc.dll vesions: 5.2.2, 5.2.1, 5.2.0, 5.1.0, 5.0.2, 5.0.1, 4.8.8
iOS version: 15.7
Xamarin.iOS: 16.0.0.72, 16.0.0.75, 15.10.0.5

The container is created like this:

var container = CurrentPlatform == Device.iOS
				? new Container(Rules.Default.WithUseInterpretation())
				: new Container();

Maybe this line - https://github.com/dadhi/DryIoc/blob/master/src/DryIoc/FastExpressionCompiler.cs#L459

This only happens in the release configuration (TestFlight) when navigating to the page again (Xamarin.Forms project)

StackTrace:
Xamarin Exception Stack:
System.PlatformNotSupportedException: Operation is not supported on this platform.
at System.Reflection.Emit.DynamicMethod..ctor (System.String name, System.Type returnType, System.Type[] parameterTypes, System.Type owner, System.Boolean skipVisibility) <0x103346df0 + 0x00010> in <ae4d2b2e1a52451bbb0fbe726a40b592#80ffc4493c7251d006b14594f2d9afb9>:0
at DryIoc.FastExpressionCompiler.LightExpression.ExpressionCompiler.CompileNoArgsNew (System.Reflection.ConstructorInfo ctor, System.Type delegateType, System.Type[] closurePlusParamTypes, System.Type returnType) <0x1048b18e4 + 0x0006f> in <78cda8c2f8b0438899aa3a8eeea13482#80ffc4493c7251d006b14594f2d9afb9>:0
at DryIoc.FastExpressionCompiler.LightExpression.ExpressionCompiler.TryCompileBoundToFirstClosureParam (System.Type delegateType, DryIoc.FastExpressionCompiler.LightExpression.Expression bodyExpr, DryIoc.FastExpressionCompiler.LightExpression.IParameterProvider paramExprs, System.Type[] closurePlusParamTypes, System.Type returnType, DryIoc.FastExpressionCompiler.LightExpression.CompilerFlags flags) <0x1048b19f8 + 0x00173> in <78cda8c2f8b0438899aa3a8eeea13482#80ffc4493c7251d006b14594f2d9afb9>:0
at DryIoc.FactoryDelegateCompiler.CompileToFactoryDelegate (DryIoc.FastExpressionCompiler.LightExpression.Expression expression, System.Boolean preferInterpretation) <0x10480bff8 + 0x0011b> in <78cda8c2f8b0438899aa3a8eeea13482#80ffc4493c7251d006b14594f2d9afb9>:0
at DryIoc.Container.DryIoc.IResolver.Resolve (System.Type serviceType, DryIoc.IfUnresolved ifUnresolved) <0x1047ee1bc + 0x0031b> in <78cda8c2f8b0438899aa3a8eeea13482#80ffc4493c7251d006b14594f2d9afb9>:0
at DryIoc.Resolver.Resolve (DryIoc.IResolver resolver, System.Type serviceType) <0x10482a170 + 0x00047> in <78cda8c2f8b0438899aa3a8eeea13482#80ffc4493c7251d006b14594f2d9afb9>:0

@dadhi
Copy link
Owner

dadhi commented Oct 19, 2022

@JustickDM Hi, thanks for reporting. I need to process what's happening here.

@JustickDM
Copy link
Author

JustickDM commented Oct 19, 2022

@JustickDM Hi, thanks for reporting. I need to process what's happening here.

Hi, 4.8.8 - same, even with the use of WithUseInterpretation + WithoutFastExpressionCompiler

@JustickDM
Copy link
Author

I migrated to Microsoft Extensions DependencyInjection and everything is fine, so you have a bug somewhere

@dadhi
Copy link
Owner

dadhi commented Oct 19, 2022

@JustickDM Ok. Regarding the issue I am trying and not able to reproduce, is it possible that CurrentPlatform == Device.iOS was false?

@JustickDM
Copy link
Author

JustickDM commented Oct 19, 2022

@JustickDM Ok. Regarding the issue I am trying and not able to reproduce, is it possible that CurrentPlatform == Device.iOS was false?

No, of course it's true. I've been using the library in production on the AppStore and Google Play for almost a year now.

dadhi added a commit that referenced this issue Oct 19, 2022
removed .net 6 Activator.CreateInstance optimization
dadhi added a commit that referenced this issue Oct 19, 2022
@dadhi dadhi self-assigned this Nov 1, 2022
@dadhi dadhi added the enhancement New feature or request label Nov 1, 2022
@dadhi dadhi added this to the v5.3.0 milestone Nov 2, 2022
@dadhi dadhi modified the milestones: v5.3.0, v6.0.0 Nov 10, 2022
@dadhi
Copy link
Owner

dadhi commented Feb 9, 2023

Linking the #552

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants