Skip to content

[jnimarshalmethod-gen] Include java-interop.jar in the installation - #3235

Merged
jonpryor merged 2 commits into
dotnet:masterfrom
radekdoulik:pr-add-java-interop-jar-to-the-installation
Jun 17, 2019
Merged

jonpryor merged 2 commits into
dotnet:masterfrom
radekdoulik:pr-add-java-interop-jar-to-the-installation

Conversation

@radekdoulik

Copy link
Copy Markdown
Member

Fixes: #3234

We had trouble creating the required java types, because
java-interop.jar was missing.

Thus we endup with:

Error: jnimarshalmethod-gen: Unable to create Java VM
System.TypeInitializationException: The type initializer for 'Types' threw an exception. ---> System.NullReferenceException: Object reference not set to an instance of an object
  at Java.Interop.JniEnvironment+Types.FindClass (System.String classname) [0x000b2] in <3d0cf794364146b58e1c173deac04834>:0
  at Java.Interop.JniType..ctor (System.String classname) [0x00006] in <3d0cf794364146b58e1c173deac04834>:0
  at Java.Interop.JniEnvironment+Types..cctor () [0x000d2] in <3d0cf794364146b58e1c173deac04834>:0
   --- End of inner exception stack trace ---
  at Java.Interop.JniType..ctor (System.String classname) [0x00006] in <3d0cf794364146b58e1c173deac04834>:0
  at Java.Interop.JniRuntime..ctor (Java.Interop.JniRuntime+CreationOptions options) [0x001b4] in <3d0cf794364146b58e1c173deac04834>:0
  at Java.Interop.JreRuntime..ctor (Java.Interop.JreRuntimeOptions builder) [0x00007] in <0837e9ee267c4328a98bfd16059a729d>:0
  at Java.Interop.JreRuntimeOptions.CreateJreVM () [0x00000] in <0837e9ee267c4328a98bfd16059a729d>:0
  at Xamarin.Android.Tools.JniMarshalMethodGenerator.App.CreateJavaVM (System.String jvmDllPath) [0x0000d] in <c1d2f255a4b541868afd675bdc42a188>:0

Fixes: dotnet#3234

We had trouble creating the required java types, because
`java-interop.jar` was missing.

Thus we endup with:

	Error: jnimarshalmethod-gen: Unable to create Java VM
	System.TypeInitializationException: The type initializer for 'Types' threw an exception. ---> System.NullReferenceException: Object reference not set to an instance of an object
	  at Java.Interop.JniEnvironment+Types.FindClass (System.String classname) [0x000b2] in <3d0cf794364146b58e1c173deac04834>:0
	  at Java.Interop.JniType..ctor (System.String classname) [0x00006] in <3d0cf794364146b58e1c173deac04834>:0
	  at Java.Interop.JniEnvironment+Types..cctor () [0x000d2] in <3d0cf794364146b58e1c173deac04834>:0
	   --- End of inner exception stack trace ---
	  at Java.Interop.JniType..ctor (System.String classname) [0x00006] in <3d0cf794364146b58e1c173deac04834>:0
	  at Java.Interop.JniRuntime..ctor (Java.Interop.JniRuntime+CreationOptions options) [0x001b4] in <3d0cf794364146b58e1c173deac04834>:0
	  at Java.Interop.JreRuntime..ctor (Java.Interop.JreRuntimeOptions builder) [0x00007] in <0837e9ee267c4328a98bfd16059a729d>:0
	  at Java.Interop.JreRuntimeOptions.CreateJreVM () [0x00000] in <0837e9ee267c4328a98bfd16059a729d>:0
	  at Xamarin.Android.Tools.JniMarshalMethodGenerator.App.CreateJavaVM (System.String jvmDllPath) [0x0000d] in <c1d2f255a4b541868afd675bdc42a188>:0
@pjcollins

Copy link
Copy Markdown
Member

@radekdoulik copying java-interop.jar from a recent build into a local install location does fix this error for me, however there are a few warnings reported that may be worth further investigation?

EXEC : warning : jnimarshalmethod-gen: No type was moved => nothing to write, no new assembly created.

jnimarshal.binlog.zip

@radekdoulik

Copy link
Copy Markdown
Member Author

These are OK, they are just informal warnings. I might just stop printing them.

@pjcollins pjcollins left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@jonpryor
jonpryor merged commit 063844c into dotnet:master Jun 17, 2019
jonpryor pushed a commit that referenced this pull request Jun 17, 2019
Fixes: #3234

We had trouble creating the required java types, because
`java-interop.jar` was missing.

Thus we end up with:

	Error: jnimarshalmethod-gen: Unable to create Java VM
	System.TypeInitializationException: The type initializer for 'Types' threw an exception. ---> System.NullReferenceException: Object reference not set to an instance of an object
	  at Java.Interop.JniEnvironment+Types.FindClass (System.String classname) [0x000b2] in <3d0cf794364146b58e1c173deac04834>:0
	  at Java.Interop.JniType..ctor (System.String classname) [0x00006] in <3d0cf794364146b58e1c173deac04834>:0
	  at Java.Interop.JniEnvironment+Types..cctor () [0x000d2] in <3d0cf794364146b58e1c173deac04834>:0
	   --- End of inner exception stack trace ---
	  at Java.Interop.JniType..ctor (System.String classname) [0x00006] in <3d0cf794364146b58e1c173deac04834>:0
	  at Java.Interop.JniRuntime..ctor (Java.Interop.JniRuntime+CreationOptions options) [0x001b4] in <3d0cf794364146b58e1c173deac04834>:0
	  at Java.Interop.JreRuntime..ctor (Java.Interop.JreRuntimeOptions builder) [0x00007] in <0837e9ee267c4328a98bfd16059a729d>:0
	  at Java.Interop.JreRuntimeOptions.CreateJreVM () [0x00000] in <0837e9ee267c4328a98bfd16059a729d>:0
	  at Xamarin.Android.Tools.JniMarshalMethodGenerator.App.CreateJavaVM (System.String jvmDllPath) [0x0000d] in <c1d2f255a4b541868afd675bdc42a188>:0
@github-actions github-actions Bot locked and limited conversation to collaborators Jan 30, 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.

jnimarshalmethod-gen.exe doesn't work in the installed XA

3 participants