Bug 6143 - "generator.exe" exited with code -1073741819
Summary: "generator.exe" exited with code -1073741819
Alias: None
Product: Android
Classification: Xamarin
Component: BCL Class Libraries ()
Version: 4.2.x
Hardware: PC Windows
: --- normal
Target Milestone: ---
Assignee: Bugzilla
Depends on:
Reported: 2012-07-16 12:41 UTC by Joseph Anderson
Modified: 2012-07-27 06:16 UTC (History)
3 users (show)

Is this bug a regression?: ---
Last known good build:

sdk (652.45 KB, application/octet-stream)
2012-07-16 12:41 UTC, Joseph Anderson
binding project (325.41 KB, application/octet-stream)
2012-07-16 12:43 UTC, Joseph Anderson
joe's code (3.41 MB, application/octet-stream)
2012-07-26 15:37 UTC, Joseph Anderson

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.

Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:

Description Joseph Anderson 2012-07-16 12:41:35 UTC
Created attachment 2201 [details]


I am trying to bind the attached library. I have attached the SDK and my binding project. Please let me know what I am doing incorrectly.

The JAR is here:

Comment 1 Joseph Anderson 2012-07-16 12:43:50 UTC
Created attachment 2202 [details]
binding project

my binding project
Comment 2 Atsushi Eno 2012-07-19 00:46:46 UTC
You should not try to bind obfuscated types which won't bind. Hence, you have to explicitly "remove" those obfuscated types by editing Transforms/Metadata.xml. Here is mine to get your library bound without error:

  <remove-node path="/api/package[@name='me.kiip.api']/class[string-length(@name)=1]" />
  <remove-node path="/api/package[@name='me.kiip.a']" />
  <remove-node path="/api/package[@name='me.kiip.b']" />
  <remove-node path="/api/package[@name='me.kiip.c']" />
  <remove-node path="/api/package[@name='me.kiip.d']" />
  <remove-node path="/api/package[@name='me.kiip.e']" />
  <remove-node path="/api/package[@name='me.kiip.f']" />
  <remove-node path="/api/package[@name='me.kiip.g']" />
  <remove-node path="/api/package[@name='me.kiip.h']" />
  <remove-node path="/api/package[@name='me.kiip.i']" />
  <remove-node path="/api/package[@name='me.kiip.j']" />
  <remove-node path="/api/package[@name='me.kiip.k']" />
  <remove-node path="/api/package[@name='me.kiip.l']" />
  <remove-node path="/api/package[@name='me.kiip.m']" />
  <remove-node path="/api/package[@name='me.kiip.n']" />
  <remove-node path="/api/package[@name='me.kiip.o']" />
  <remove-node path="/api/package[@name='me.kiip.p']" />
  <remove-node path="/api/package[@name='me.kiip.q']" />
  <remove-node path="/api/package[@name='me.kiip.r']" />
Comment 3 Joseph Anderson 2012-07-26 15:37:49 UTC
Created attachment 2265 [details]
joe's code

this is Joseph's updated code, which translated Kiip's sample app. Please use this for the latest ticket.
Comment 4 Joseph Anderson 2012-07-26 15:39:25 UTC
There is an issue here:

ExampleActivity > 

public void onFinished(Kiip manager, Resource response) 

Mono returns 

public void OnFinished(Kiip p0, Java.Lang.Object p1)

Resource is the designer class and I believe Visual Studio gets confused. When I try to case Object to ME.Kiip.Resource, p1 becomes null.
Comment 5 Jonathan Pryor 2012-07-26 16:24:20 UTC
The reason why onFinish(Kiip, Resource) is bound as Object is because it's in a generic interface:

    public interface RequestListener<T> {
        void onFinished(Kiip, T);
        void onError(Kiip, KiipException);

Due to the "joys" of Java generics, these don't actually exist:

> javap -classpath Jars/kiip-1.0.14.jar me.kiip.api.Kiip.RequestListener
> Compiled from Kiip
> public interface me.kiip.api.Kiip$RequestListener{
>     public abstract void onFinished(me.kiip.api.Kiip, java.lang.Object);
>     public abstract void onError(me.kiip.api.Kiip, me.kiip.api.KiipException);
> }

Notice that the 2nd onFinished() parameter is actually java.lang.Object, which is why it's bound as Java.Lang.Object.

As for why p1 is null, the actual code is:

> // http://stackoverflow.com/questions/11652781/monodroid-c-sharp-translate
> ME.Kiip.Api.Resource response = p1 as ME.Kiip.Api.Resource;

I need to investigate why this was failing, but the current workaround is to use the JavaCast<T>() extension method:

    var response = p1.JavaCast<ME.Kiip.Api.Resource>();

See: http://androidapi.xamarin.com/?link=M:Android.Runtime.Extensions.JavaCast{TResult}
Comment 8 Atsushi Eno 2012-07-27 06:16:54 UTC
It was reopened only to mention obfuscated types could have been filtered out, but keeping this bug (which contains multiple issues) open gives false assumption to users that some of the problems mentioned above is a bug.