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

[jnimarshalmethod-gen] Fix registration on Windows #721

Merged

Conversation

radekdoulik
Copy link
Contributor

Set parameters to registration method builder, to get rid of exception
we are getting on Windows. Looks like the S.L.E code still differs
between Windows and Mac.

Also report adding registration methods in verbose mode, similar as we
do with marshal methods.

The ArgumentOutOfRangeException mentined above:

error JM4006: jnimarshalmethod-gen: Unable to process assembly '.\bin\TestDebug\Java.Interop.Export-Tests.dll'
Specified argument was out of the range of valid values.
Parameter name: The specified parameter index is not in range.
System.ArgumentOutOfRangeException: Specified argument was out of the range of valid values.
Parameter name: The specified parameter index is not in range.
   at System.Reflection.Emit.MethodBuilder.DefineParameter(Int32 position, ParameterAttributes attributes, String strParamName)
   at System.Linq.Expressions.Compiler.LambdaCompiler..ctor(AnalyzedTree tree, LambdaExpression lambda, MethodBuilder method)
   at System.Linq.Expressions.Compiler.LambdaCompiler.Compile(LambdaExpression lambda, MethodBuilder method, DebugInfoGenerator debugInfoGenerator)
   at Xamarin.Android.Tools.JniMarshalMethodGenerator.App.AddRegisterNativeMembers(TypeBuilder dt, ParameterExpression targetType, List`1 registrationElements) in C:\Users\rodo\git\java.interop\tools\jnimarshalmethod-gen\App.cs:line 564
   at Xamarin.Android.Tools.JniMarshalMethodGenerator.App.CreateMarshalMethodAssembly(String path) in C:\Users\rodo\git\java.interop\tools\jnimarshalmethod-gen\App.cs:line 426
   at Xamarin.Android.Tools.JniMarshalMethodGenerator.App.ProcessAssemblies(List`1 assemblies) in C:\Users\rodo\git\java.interop\tools\jnimarshalmethod-gen\App.cs:line 201

Set parameters to registration method builder, to get rid of exception
we are getting on Windows. Looks like the S.L.E code still differs
between Windows and Mac.

Also report adding registration methods in verbose mode, similar as we
do with marshal methods.

The ArgumentOutOfRangeException mentined above:

    error JM4006: jnimarshalmethod-gen: Unable to process assembly '.\bin\TestDebug\Java.Interop.Export-Tests.dll'
    Specified argument was out of the range of valid values.
    Parameter name: The specified parameter index is not in range.
    System.ArgumentOutOfRangeException: Specified argument was out of the range of valid values.
    Parameter name: The specified parameter index is not in range.
       at System.Reflection.Emit.MethodBuilder.DefineParameter(Int32 position, ParameterAttributes attributes, String strParamName)
       at System.Linq.Expressions.Compiler.LambdaCompiler..ctor(AnalyzedTree tree, LambdaExpression lambda, MethodBuilder method)
       at System.Linq.Expressions.Compiler.LambdaCompiler.Compile(LambdaExpression lambda, MethodBuilder method, DebugInfoGenerator debugInfoGenerator)
       at Xamarin.Android.Tools.JniMarshalMethodGenerator.App.AddRegisterNativeMembers(TypeBuilder dt, ParameterExpression targetType, List`1 registrationElements) in C:\Users\rodo\git\java.interop\tools\jnimarshalmethod-gen\App.cs:line 564
       at Xamarin.Android.Tools.JniMarshalMethodGenerator.App.CreateMarshalMethodAssembly(String path) in C:\Users\rodo\git\java.interop\tools\jnimarshalmethod-gen\App.cs:line 426
       at Xamarin.Android.Tools.JniMarshalMethodGenerator.App.ProcessAssemblies(List`1 assemblies) in C:\Users\rodo\git\java.interop\tools\jnimarshalmethod-gen\App.cs:line 201
@jonpryor jonpryor merged commit 53d6051 into xamarin:master Sep 18, 2020
@jpobst jpobst added this to the 11.1 (16.9 / 8.9) milestone Sep 22, 2020
@github-actions github-actions bot locked and limited conversation to collaborators Apr 13, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants