This is Xamarin's bug tracking system. For product support, please use the support links listed in your Xamarin Account.
Bug 6695 - Unable to use "Java Bindings Library"
: Unable to use "Java Bindings Library"
Product: Xamarin Studio
Classification: Desktop
Component: Android Add-in
: 3.0.x
: PC Windows
: Normal normal
: ---
Assigned To: Mike Krüger
  Show dependency treegraph
Reported: 2012-08-26 21:26 EDT by Justin
Modified: 2012-11-20 03:21 EST (History)
6 users (show)

See Also:

A java bindings library project and a sample applicatin (4.39 MB, application/octet-stream)
2012-08-27 13:18 EDT, Justin

Description Justin 2012-08-26 21:26:55 EDT
I followed the recipe at
for creating a .NET wrapper around a java library. I can compiled the Java
Bindings project with no errors. However, when I reference the project from an
Android application project, I cannot see any of the namespaces, classes, or
other members of the Java Bindings project.

If you download the sample code given in the article
(, and try to
reference the "MyGoogleMaps" library, you will see the same problem.

I tried the latest alpha of Mono for Android and it didn't seem to help.
Comment 1 mhutch 2012-08-27 10:57:21 EDT
You can work around this by using a dll reference instead of a project

*** This bug has been marked as a duplicate of bug 5966 ***
Comment 2 Justin 2012-08-27 11:24:13 EDT
I tried that and got the same result.

BTW, I can't access the original bug you linked - is it private?
Comment 3 mhutch 2012-08-27 12:13:26 EDT
*** Bug 5966 has been marked as a duplicate of this bug. ***
Comment 4 mhutch 2012-08-27 12:16:07 EDT
Yes, it is, unfortunately the initial filing of that bug included an attachment
that needs to be kept private. We'd been keeping it as the primary bug because
it has some extensive discussions about how to solve this in the comments,
however it couldn't be tracked in public, which is a problem.

I've now marked it as a dup of this bug - we'll have to refer to that one for
the older discussions.
Comment 5 mhutch 2012-08-27 12:24:19 EDT
Here is some explanation copy-pasted from the earlier bug:

The reason the types are unresolved in unresolved in the syntax highlighting
and in code completion is a consequence of the way that the Android binding
projects work - they generate the binding source code at compile time and
inject it into the build. So it's simply not available to the C# parser.

The reason the workaround works is that when it's changed from a project
reference to a dll reference, parses the dll instead of the source code.
However, that's an imperfect solution - it won't work unless the binding dll
has already been built, not will it pick up changes until the binding project
is rebuilt.

One possible fix would be to change binding projects so that the generated code
is part of the project, maybe as "children" (dependent files) of the jar file.
The project would have to run the jar processing MSBuild target when adding or
updating the jar file. This would be very similar to what we do with the
Resource.designer.cs file.

Any other fixes would be much, much more difficult. For example, implementing a
code completion parser for jar files that would parse them directly into MD's
type system, which would be a duplication of all the binding generation code.

Using the dll parser instead of the C# parser for java binding projects is an
option, but it would have the same issues as dll references.
Comment 6 Justin 2012-08-27 12:35:22 EDT
Thanks for pasting that info; I went back and looked at my project.  I can
build my project just fine - it's only intellisense that's missing. My earlier
comment about the DLL reference (and project reference) is incorrect.

It's strange I don't get any intellisense with a DLL reference though - any
Comment 7 mhutch 2012-08-27 12:51:15 EDT
No idea. Can you send us the project so we can take a look? You can attach it
and mark it private or send it to
Comment 8 Justin 2012-08-27 13:18:49 EDT
Created attachment 2417 [details]
A java bindings library project and a sample applicatin

The AWSDynamoBinding project binds some Amazon java libraries. The HelloAndroid
project references the AWSDynamoBinding project. Activity1.cs refers to a class
from AWSDynamoBinding (private static
Com.Amazonaws.Services.Dynamodb.Model.Condition foo); the project will compile,
but intellisense does not see any classes or types exported from the
AWSDynamoBinding project.
Comment 13 Mike Krüger 2012-08-29 05:56:50 EDT

Completion now works after compiling the binding project.
Comment 14 mhutch 2012-08-31 11:56:21 EDT
*** Bug 6756 has been marked as a duplicate of this bug. ***
Comment 15 Justin 2012-09-04 12:23:41 EDT
What build of MonoDevelop will this fix land in? Is it already availabe on the
alpha or beta channels?
Comment 16 Mike Krüger 2012-09-05 01:11:46 EDT
In 3.1.x - it's atm not available, but we're working on it.
Comment 17 Miguel de Icaza 2012-10-13 10:48:15 EDT
We need to backport these to the stable series, since the upcoming 4.0 wont be
out until January or so.
Comment 18 Chris Hardy 2012-11-16 06:36:15 EST
Did this get backported to 3.0, along with issue 6719 - ?
Comment 19 Mike Krüger 2012-11-20 03:21:49 EST
Y it did

Note You need to log in before you can comment on or make changes to this bug.