Bug 5143 - .jar binding shouldn't fail due to missing types
Summary: .jar binding shouldn't fail due to missing types
Status: RESOLVED FIXED
Alias: None
Product: Android
Classification: Xamarin
Component: Tools and Addins ()
Version: 4.1.x
Hardware: PC Mac OS
: Normal normal
Target Milestone: ---
Assignee: Atsushi Eno
URL:
Depends on:
Blocks:
 
Reported: 2012-05-17 10:50 UTC by Jonathan Pryor
Modified: 2012-05-25 05:51 UTC (History)
2 users (show)

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

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:
Status:
RESOLVED FIXED

Description Jonathan Pryor 2012-05-17 10:50:01 UTC
Consider the PhoneGap library

    https://github.com/phonegap/phonegap/zipball/1.7.0

(You'll want the phonegap-phonegap-475bfd2/lib/android/cordova-1.7.0.jar file within the above download.)

If you add cordova-1.7.0.jar to a .jar binding project, the build will fail, e.g.

> obj/Debug/generated/src/Org.Apache.Cordova.Api.ICordovaInterface.cs(834,84): error CS0234: The type or namespace name `IPlugin' does not exist in the namespace `Org.Apache.Cordova.Api'. Are you missing an assembly reference?

The reason is that org.apache.cordova.api.IPlugin can't be bound:

> Unknown parameter type org.json.JSONArray found in method Execute in type Org.Apache.Cordova.Api.IPlugin

Fair enough, the IPlugin type can't be bound. So why is it still being used? Every tyep that implements IPlugin should have IPlugin removed from the inheritance list, and every method that has an IPlugin parameter or return type should be skipped. Instead, they're all generated, resulting in compilation errors.

This shouldn't error, we should instead fail gracefully and just not bind the unbindable members.
Comment 3 Atsushi Eno 2012-05-21 04:05:41 UTC
Smells like the same issue as bug #5111.
Comment 4 Atsushi Eno 2012-05-21 04:08:24 UTC
Well, actually not. While #5111 says it's about missing types, we don't have that issue anymore, even if existed.
Comment 5 Atsushi Eno 2012-05-25 05:51:53 UTC
This is fixed, by recursively validating types and members so that invalidated types are completely ignored.