Bug 5241 - .jar binding should ensure that referenced files exist
Summary: .jar binding should ensure that referenced files exist
Alias: None
Product: Android
Classification: Xamarin
Component: Tools and Addins ()
Version: 4.2.x
Hardware: PC Mac OS
: --- normal
Target Milestone: ---
Assignee: Bugzilla
Depends on:
Reported: 2012-05-22 11:45 UTC by Jonathan Pryor
Modified: 2012-05-22 12:03 UTC (History)
2 users (show)

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:

Description Jonathan Pryor 2012-05-22 11:45:37 UTC
This came up on #monodroid today: a .jar binding project failed.

Diagnostic MSBuild output:


The key output:

> C:\Program Files (x86)\Java\jdk1.6.0_27\bin\java.exe -jar "C:\Program Files (x86)\MSBuild\Novell\jar2xml.jar" --jar="C:\Users\Jose\Documents\Visual Studio 2010\Projects\vmac\EpsonCom21\Jars\EpsonCom2.1.jar" --ref="C:\Program Files (x86)\Android\android-sdk\platforms\android-8\android.jar" --out="C:\Users\Jose\Documents\Visual Studio 2010\Projects\vmac\EpsonCom21\obj\Debug\api.xml" (TaskId:33)
> Couldn't load class com/epson/EpsonCom/EpsonCom (TaskId:33)
> Exception in thread "main" java.lang.NoClassDefFoundError: android/app/Activity (TaskId:33)
> at java.lang.ClassLoader.defineClass1(Native Method) (TaskId:33)

Binding failed because android.app.Activity couldn't be found, because the file "C:\Program Files (x86)\Android\android-sdk\platforms\android-8\android.jar" didn't exist (they hadn't installed API8).

We should provide a better error message here: either the MSBuild tasks should ensure that the referenced assemblies exist, or jar2xml should assert that the --ref files actually exist.
Comment 1 Jonathan Pobst 2012-05-22 12:03:55 UTC
Fixed in 84a6e7d3764112c94b367abc16a5834deec3b9f8.