Bug 4288

Summary: Error building a Java Library Binding project ("java.exe" exited with code 1.)
Product: Android Reporter: michele.scandura
Component: MSBuildAssignee: Jonathan Pryor <jonp>
Status: RESOLVED FIXED    
Severity: normal CC: atsushi, jpobst, kenny.goers, Koen.Stroobants, mono-bugs+monodroid
Priority: ---    
Version: 4.1.x   
Target Milestone: ---   
Hardware: PC   
OS: Windows   
Tags: Is this bug a regression?: ---
Last known good build:

Description michele.scandura 2012-04-06 05:25:47 UTC
I just installed monodroid alpha 4.1 and I'm trying to create a Binding Library project using the OSMDroid jar. 
OSMDroid is an opensource mapview implementation, basically a replacement for the google maps mapview. I followed the steps in the tutorial, but i get only an error message saying

C:\Program Files (x86)\MSBuild\Novell\Xamarin.Android.Bindings.targets(170,5): error MSB6006: "java.exe" exited with code 1.
Comment 1 Jonathan Pobst 2012-04-06 10:41:44 UTC
Link to OSMDroid from the SO question:
http://code.google.com/p/osmdroid/
Comment 2 Jonathan Pobst 2012-04-06 14:57:01 UTC
Actual error:

  Exception in thread "main" java.lang.NoClassDefFoundError: org/slf4j/Logger (TaskId:22)
  	at java.lang.Class.getDeclaredMethods0(Native Method) (TaskId:22)
  	at java.lang.Class.privateGetDeclaredMethods(Class.java:2442) (TaskId:22)
  	at java.lang.Class.getDeclaredMethods(Class.java:1808) (TaskId:22)
  	at jar2xml.JavaClass.appendToDocument(JavaClass.java:466) (TaskId:22)
  	at jar2xml.JavaPackage.appendToDocument(JavaPackage.java:66) (TaskId:22)
  	at jar2xml.Start.main(Start.java:157) (TaskId:22)
  Caused by: java.lang.ClassNotFoundException: org.slf4j.Logger (TaskId:22)
  	at java.net.URLClassLoader$1.run(URLClassLoader.java:366) (TaskId:22)
  	at java.net.URLClassLoader$1.run(URLClassLoader.java:355) (TaskId:22)
  	at java.security.AccessController.doPrivileged(Native Method) (TaskId:22)
  	at java.net.URLClassLoader.findClass(URLClassLoader.java:354) (TaskId:22)
  	at java.lang.ClassLoader.loadClass(ClassLoader.java:423) (TaskId:22)
  	at java.lang.ClassLoader.loadClass(ClassLoader.java:356) (TaskId:22)
  	... 6 more (TaskId:22)
C:\Program Files (x86)\MSBuild\Novell\Xamarin.Android.Bindings.targets(170,5): error MSB6006: "java.exe" exited with code 1.
Comment 3 Atsushi Eno 2012-04-09 05:05:49 UTC
org.slf4j is from http://www.slf4j.org/ , right? You have to add *all* referenced Java libraries (*.jar files) to the project and set file type as "ReferenceJar".

If this still results in errors, please reopen this bug.
Comment 4 Koen Stroobants 2012-04-10 03:03:42 UTC
I have a similar issue when trying to add Esri Adnroid api
Comment 5 kenny goers 2012-05-10 20:57:06 UTC
You will need the slf4j-api(-1.6.4) JAR, It's a facade that many use, add it as a referenced JAR.
Comment 6 Atsushi Eno 2012-05-21 04:04:34 UTC
Reopening, as this exposed some access modifier inconsistency issues and override resolution issue, as well as string literal escape issue (the latter one is fixed).

	/svn/monodroid-samples/OsmDroid/OsmDroid/obj/Debug/generated/src/Org.Osmdroid.Tileprovider.Modules.MapTileDownloader.cs(11,42): error CS0060: Inconsistent accessibility: base class `Org.Osmdroid.Tileprovider.Modules.MapTileModuleProviderBase.TileLoader' is less accessible than class `Org.Osmdroid.Tileprovider.Modules.MapTileDownloader.TileLoader'
	/svn/monodroid-samples/OsmDroid/OsmDroid/obj/Debug/generated/src/Org.Osmdroid.Tileprovider.Modules.MapTileFileArchiveProvider.cs(28,42): error CS0060: Inconsistent accessibility: base class `Org.Osmdroid.Tileprovider.Modules.MapTileModuleProviderBase.TileLoader' is less accessible than class `Org.Osmdroid.Tileprovider.Modules.MapTileFileArchiveProvider.TileLoader'
	/svn/monodroid-samples/OsmDroid/OsmDroid/obj/Debug/generated/src/Org.Osmdroid.Tileprovider.Modules.MapTileFilesystemProvider.cs(11,42): error CS0060: Inconsistent accessibility: base class `Org.Osmdroid.Tileprovider.Modules.MapTileModuleProviderBase.TileLoader' is less accessible than class `Org.Osmdroid.Tileprovider.Modules.MapTileFilesystemProvider.TileLoader'
	/svn/monodroid-samples/OsmDroid/OsmDroid/obj/Debug/generated/src/Org.Osmdroid.Tileprovider.MapTileProviderBase.cs(525,45): error CS0533: `Org.Osmdroid.Tileprovider.MapTileProviderBase.ZoomInTileLooper.HandleTile(int, Org.Osmdroid.Tileprovider.MapTile, int, int)' hides inherited abstract member `Org.Osmdroid.Tileprovider.MapTileProviderBase.ScaleTileLooper.HandleTile(int, Org.Osmdroid.Tileprovider.MapTile, int, int)'
	/svn/monodroid-samples/OsmDroid/OsmDroid/obj/Debug/generated/src/Org.Osmdroid.Tileprovider.Modules.MapTileDownloader.cs(50,84): error CS0533: `Org.Osmdroid.Tileprovider.Modules.MapTileDownloader.TileLoader.LoadTile(Org.Osmdroid.Tileprovider.MapTileRequestState)' hides inherited abstract member `Org.Osmdroid.Tileprovider.Modules.MapTileModuleProviderBase.TileLoader.LoadTile(Org.Osmdroid.Tileprovider.MapTileRequestState)'
	/svn/monodroid-samples/OsmDroid/OsmDroid/obj/Debug/generated/src/Org.Osmdroid.Tileprovider.Modules.MapTileFileArchiveProvider.cs(67,84): error CS0533: `Org.Osmdroid.Tileprovider.Modules.MapTileFileArchiveProvider.TileLoader.LoadTile(Org.Osmdroid.Tileprovider.MapTileRequestState)' hides inherited abstract member `Org.Osmdroid.Tileprovider.Modules.MapTileModuleProviderBase.TileLoader.LoadTile(Org.Osmdroid.Tileprovider.MapTileRequestState)'
	/svn/monodroid-samples/OsmDroid/OsmDroid/obj/Debug/generated/src/Org.Osmdroid.Tileprovider.Modules.MapTileFilesystemProvider.cs(50,84): error CS0533: `Org.Osmdroid.Tileprovider.Modules.MapTileFilesystemProvider.TileLoader.LoadTile(Org.Osmdroid.Tileprovider.MapTileRequestState)' hides inherited abstract member `Org.Osmdroid.Tileprovider.Modules.MapTileModuleProviderBase.TileLoader.LoadTile(Org.Osmdroid.Tileprovider.MapTileRequestState)'
	/svn/monodroid-samples/OsmDroid/OsmDroid/obj/Debug/generated/src/Org.Osmdroid.Views.Overlay.DirectedLocationOverlay.cs(223,37): error CS0533: `Org.Osmdroid.Views.Overlay.DirectedLocationOverlay.Draw(Android.Graphics.Canvas, Org.Osmdroid.Views.MapView, bool)' hides inherited abstract member `Org.Osmdroid.Views.Overlay.Overlay.Draw(Android.Graphics.Canvas, Org.Osmdroid.Views.MapView, bool)'
	/svn/monodroid-samples/OsmDroid/OsmDroid/obj/Debug/generated/src/Org.Osmdroid.Views.Overlay.ItemizedOverlay.cs(210,37): error CS0533: `Org.Osmdroid.Views.Overlay.ItemizedOverlay.Draw(Android.Graphics.Canvas, Org.Osmdroid.Views.MapView, bool)' hides inherited abstract member `Org.Osmdroid.Views.Overlay.Overlay.Draw(Android.Graphics.Canvas, Org.Osmdroid.Views.MapView, bool)'
	/svn/monodroid-samples/OsmDroid/OsmDroid/obj/Debug/generated/src/Org.Osmdroid.Views.Overlay.ItemizedOverlay.cs(420,41): error CS0507: `Org.Osmdroid.Views.Overlay.ItemizedOverlayInvoker.Draw(Android.Graphics.Canvas, Org.Osmdroid.Views.MapView, bool)': cannot change access modifiers when overriding `public' inherited member `Org.Osmdroid.Views.Overlay.ItemizedOverlay.Draw(Android.Graphics.Canvas, Org.Osmdroid.Views.MapView, bool)'
	/svn/monodroid-samples/OsmDroid/OsmDroid/obj/Debug/generated/src/Org.Osmdroid.Views.Overlay.MyLocationOverlay.cs(906,37): error CS0533: `Org.Osmdroid.Views.Overlay.MyLocationOverlay.Draw(Android.Graphics.Canvas, Org.Osmdroid.Views.MapView, bool)' hides inherited abstract member `Org.Osmdroid.Views.Overlay.Overlay.Draw(Android.Graphics.Canvas, Org.Osmdroid.Views.MapView, bool)'
	/svn/monodroid-samples/OsmDroid/OsmDroid/obj/Debug/generated/src/Org.Osmdroid.Views.Overlay.ScaleBarOverlay.cs(328,37): error CS0533: `Org.Osmdroid.Views.Overlay.ScaleBarOverlay.Draw(Android.Graphics.Canvas, Org.Osmdroid.Views.MapView, bool)' hides inherited abstract member `Org.Osmdroid.Views.Overlay.Overlay.Draw(Android.Graphics.Canvas, Org.Osmdroid.Views.MapView, bool)'
	/svn/monodroid-samples/OsmDroid/OsmDroid/obj/Debug/generated/src/Org.Osmdroid.Views.Overlay.SimpleLocationOverlay.cs(179,37): error CS0533: `Org.Osmdroid.Views.Overlay.SimpleLocationOverlay.Draw(Android.Graphics.Canvas, Org.Osmdroid.Views.MapView, bool)' hides inherited abstract member `Org.Osmdroid.Views.Overlay.Overlay.Draw(Android.Graphics.Canvas, Org.Osmdroid.Views.MapView, bool)'
Comment 9 Jonathan Pryor 2012-06-01 11:41:56 UTC
Android.Graphics.Color remapping support fixed in commit a39a6ad4.