Bug 14461 - Unable to bind Caplin Stream Link for Java
Summary: Unable to bind Caplin Stream Link for Java
Status: RESOLVED FEATURE
Alias: None
Product: Android
Classification: Xamarin
Component: Bindings ()
Version: 4.8.x
Hardware: Macintosh Mac OS
: --- normal
Target Milestone: ---
Assignee: Atsushi Eno
URL:
Depends on:
Blocks:
 
Reported: 2013-09-05 11:02 UTC by fkuciapa
Modified: 2013-09-09 11:22 UTC (History)
1 user (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 FEATURE

Description fkuciapa 2013-09-05 11:02:28 UTC
Find the reproducible issue in the following project:
https://dl.dropboxusercontent.com/u/103682733/SLBindingLibrary.zip

I get tons of errors and warnings:

Full Error log is here:

https://dl.dropboxusercontent.com/u/103682733/slbinding-errorlog.rtf


Cleaning Solution: SLBindingLibrary (Debug)

Cleaning: SLBindingLibrary (Debug)

Build started 9/5/2013 4:29:43 PM.
__________________________________________________
Project "/Users/abc/Projects/SLBindingLibrary/SLBindingLibrary/SLBindingLibrary.csproj" (Clean target(s)):
	
	Target CoreClean:
		Deleting file '/Users/abc/Projects/SLBindingLibrary/SLBindingLibrary/obj/Debug/MonoAndroid,Version=v4.0.AssemblyAttribute.cs'
		Deleting file '/Users/abc/Projects/SLBindingLibrary/SLBindingLibrary/obj/Debug/SLBindingLibrary.Jars.rtjl-4.4.14.jar'
		Deleting file '/Users/abc/Projects/SLBindingLibrary/SLBindingLibrary/obj/Debug/SLBindingLibrary.Jars.failover-4.4.14.jar'
		Deleting file '/Users/abc/Projects/SLBindingLibrary/SLBindingLibrary/obj/Debug/SLBindingLibrary.Jars.aelfred-4.4.14.jar'
		Deleting file '/Users/abc/Projects/SLBindingLibrary/SLBindingLibrary/obj/Debug/SLBindingLibrary.Jars.rttp-4.4.14.jar'
		Deleting file '/Users/abc/Projects/SLBindingLibrary/SLBindingLibrary/obj/Debug/SLBindingLibrary.csproj.FilesWrittenAbsolute.txt'
	
	Target CleanBindingsOutput:
		Deleting file '/Users/abc/Projects/SLBindingLibrary/SLBindingLibrary/obj/Debug/api.xml'
		Deleting file '/Users/abc/Projects/SLBindingLibrary/SLBindingLibrary/obj/Debug/generator.stamp'
		  RemovedDirectories: 
		    obj/Debug/generated/
Done building project "/Users/abc/Projects/SLBindingLibrary/SLBindingLibrary/SLBindingLibrary.csproj".

Build succeeded.
	 0 Warning(s)
	 0 Error(s)

Time Elapsed 00:00:00.2176640

Building Solution: SLBindingLibrary (Debug)

Building: SLBindingLibrary (Debug)

Build started 9/5/2013 4:29:43 PM.
__________________________________________________
Project "/Users/abc/Projects/SLBindingLibrary/SLBindingLibrary/SLBindingLibrary.csproj" (Build target(s)):
	
	Target _ResolveMonoAndroidSdks:
		MonoAndroid Tools: /Library/Frameworks/Xamarin.Android.framework/Versions/Current/lib/mandroid/
		MonoAndroid Framework: /Library/Frameworks/Xamarin.Android.framework/Versions/Current/lib/mandroid/platforms/android-14;/Library/Frameworks/Xamarin.Android.framework/Versions/Current/lib/mono/2.1
		Android SDK: /Users/abc/Library/Developer/Xamarin/android-sdk-mac_x86/
		Java SDK: /usr/
		Android Platform API level: 14
		TargetFrameworkVersion: v4.0
	
	Target ResolveLibraryProjects:
	No input files were specified for target ResolveLibraryProjects, skipping.
	
	Target ExportJarToXml:
		  Assemblies: 
		    /Library/Frameworks/Xamarin.Android.framework/Versions/Current/lib/mono/2.1/System.dll
		    /Library/Frameworks/Xamarin.Android.framework/Versions/Current/lib/mono/2.1/System.Xml.dll
		    /Library/Frameworks/Xamarin.Android.framework/Versions/Current/lib/mandroid/platforms/android-14/Mono.Android.dll
		    /Library/Frameworks/Xamarin.Android.framework/Versions/Current/lib/mono/2.1/System.Core.dll
		  Jars: 
		  ResolvedResourceDirectories: 
		  SourceJars:
		    Jars/rtjl-4.4.14.jar
		  ReferenceJars:
		    Jars/failover-4.4.14.jar
		    Jars/aelfred-4.4.14.jar
		    Jars/rttp-4.4.14.jar
		Tool /usr/bin/java execution started with arguments: -jar /Library/Frameworks/Xamarin.Android.framework/Versions/Current/lib/mandroid/jar2xml.jar --jar=/Users/abc/Projects/SLBindingLibrary/SLBindingLibrary/Jars/rtjl-4.4.14.jar --ref=/Users/abc/Library/Developer/Xamarin/android-sdk-mac_x86/platforms/android-14/android.jar --out=/Users/abc/Projects/SLBindingLibrary/SLBindingLibrary/obj/Debug/api.xml --ref=/Users/abc/Projects/SLBindingLibrary/SLBindingLibrary/Jars/failover-4.4.14.jar --ref=/Users/abc/Projects/SLBindingLibrary/SLBindingLibrary/Jars/aelfred-4.4.14.jar --ref=/Users/abc/Projects/SLBindingLibrary/SLBindingLibrary/Jars/rttp-4.4.14.jar 
		  RemovedDirectories: 
		    /var/folders/3b/33bsycjs6_z3tq32c0nc3t600000gn/T/jbt3ad6i.qkb
	
	Target PrepareForBuild:
		Configuration: Debug Platform: AnyCPU
	
	Target GenerateBindings:
		  TransformFiles:
		    Transforms/EnumFields.xml
		    Transforms/EnumMethods.xml
		    Transforms/Metadata.xml
		  ReferencedManagedLibraries:
		    /Library/Frameworks/Xamarin.Android.framework/Versions/Current/lib/mono/2.1/System.dll
		    /Library/Frameworks/Xamarin.Android.framework/Versions/Current/lib/mono/2.1/System.Xml.dll
		    /Library/Frameworks/Xamarin.Android.framework/Versions/Current/lib/mandroid/platforms/android-14/Mono.Android.dll
		    /Library/Frameworks/Xamarin.Android.framework/Versions/Current/lib/mono/2.1/System.Core.dll
		Adding transform file Transforms/EnumFields.xml as enumfields.
		Adding transform file Transforms/EnumMethods.xml as enummethods.
		Adding transform file Transforms/Metadata.xml as metadata.
		Tool /Library/Frameworks/Xamarin.Android.framework/Versions/Current/bin/generator execution started with arguments: obj/Debug/api.xml --csdir=obj/Debug/generated/src --enumdir=obj/Debug/generated/enums --enummetadata=obj/Debug/generated/metadata --assembly=SLBindingLibrary --ref=/Library/Frameworks/Xamarin.Android.framework/Versions/Current/lib/mono/2.1/mscorlib.dll --ref=/Library/Frameworks/Xamarin.Android.framework/Versions/Current/lib/mono/2.1/System.dll --ref=/Library/Frameworks/Xamarin.Android.framework/Versions/Current/lib/mono/2.1/System.Xml.dll --ref=/Library/Frameworks/Xamarin.Android.framework/Versions/Current/lib/mandroid/platforms/android-14/Mono.Android.dll --ref=/Library/Frameworks/Xamarin.Android.framework/Versions/Current/lib/mono/2.1/System.Core.dll --enumfields=Transforms/EnumFields.xml --enummethods=Transforms/EnumMethods.xml --fixup=Transforms/Metadata.xml --api-level=14 --global --public 
		resolving assembly /Library/Frameworks/Xamarin.Android.framework/Versions/Current/lib/mono/2.1/mscorlib.dll
		resolving assembly /Library/Frameworks/Xamarin.Android.framework/Versions/Current/lib/mono/2.1/System.dll
		resolving assembly /Library/Frameworks/Xamarin.Android.framework/Versions/Current/lib/mono/2.1/System.Xml.dll
		resolving assembly /Library/Frameworks/Xamarin.Android.framework/Versions/Current/lib/mandroid/platforms/android-14/Mono.Android.dll
		resolving assembly /Library/Frameworks/Xamarin.Android.framework/Versions/Current/lib/mono/2.1/System.Core.dll
:  warning BG8900: Type com.caplin.credentials.Credentials: FxDG naming violation: Type name 'Credentials' matches namespace part 'Credentials'.
:  warning BG8900: Type com.caplin.util.random.Random: FxDG naming violation: Type name 'Random' matches namespace part 'Random'.
:  warning BG8700: Unknown return type com.rttp.util.RTTPEncodable
		 found in method EncodeWithValues
		 in type Com.Rttp.Rtjl.IRTTPTarget
:  warning BG8700: Unknown return type com.rttp.util.RTTPEncodable
		 found in method EncodeWithoutValues
		 in type Com.Rttp.Rtjl.IRTTPTarget
:  warning BG8503: Invalidating Com.Rttp.Rtjl.IRTTPTarget and all nested types because some of its methods were invalid
:  warning BG8C00: For type Com.Rttp.Rtjl.IUniqueRTTPTarget, base interface com.rttp.rtjl.RTTPTarget is invalid.
:  warning BG8700: Unknown return type com.rttp.util.RTTPEncodable
		 found in method GetDifferentiator
		 in type Com.Rttp.Rtjl.IUniqueRTTPTarget
:  warning BG8502: Invalidating Com.Rttp.Rtjl.IUniqueRTTPTarget and all nested types because some of its interfaces were invalid
:  warning BG8801: Invalid parameter type com.rttp.rtjl.UniqueRTTPTarget
		 found in method ActionFailed
		 in type Com.Rttp.Rtjl.Subscriber.IUniqueRTTPSubscriber
:  warning BG8801: Invalid parameter type com.rttp.rtjl.UniqueRTTPTarget
		 found in method ActiveRequest
		 in type Com.Rttp.Rtjl.Subscriber.IUniqueRTTPSubscriber
:  warning BG8801: Invalid parameter type com.rttp.rtjl.UniqueRTTPTarget
		 found in method ChatUpdated
		 in type Com.Rttp.Rtjl.Subscriber.IUniqueRTTPSubscriber
:  warning BG8801: Invalid parameter type com.rttp.rtjl.UniqueRTTPTarget
		 found in method ContributeOk
		 in type Com.Rttp.Rtjl.Subscriber.IUniqueRTTPSubscriber
:  warning BG8801: Invalid parameter type com.rttp.rtjl.UniqueRTTPTarget
		 found in method CreateOk
		 in type Com.Rttp.Rtjl.Subscriber.IUniqueRTTPSubscriber
:  warning BG8801: Invalid parameter type com.rttp.rtjl.UniqueRTTPTarget
		 found in method DeleteOk
		 in type Com.Rttp.Rtjl.Subscriber.IUniqueRTTPSubscriber
:  warning BG8801: Invalid parameter type com.rttp.rtjl.UniqueRTTPTarget
		 found in method DirectoryUpdated
		 in type Com.Rttp.Rtjl.Subscriber.IUniqueRTTPSubscriber
:  warning BG8801: Invalid parameter type com.rttp.rtjl.UniqueRTTPTarget
		 found in method NewsCacheSize
		 in type Com.Rttp.Rtjl.Subscriber.IUniqueRTTPSubscriber
:  warning BG8801: Invalid parameter type com.rttp.rtjl.UniqueRTTPTarget
		 found in method NewsUpdated
		 in type Com.Rttp.Rtjl.Subscriber.IUniqueRTTPSubscriber
:  warning BG8801: Invalid parameter type com.rttp.rtjl.UniqueRTTPTarget
		 found in method ObjectStatusUpdated
		 in type Com.Rttp.Rtjl.Subscriber.IUniqueRTTPSubscriber
:  warning BG8801: Invalid parameter type com.rttp.rtjl.UniqueRTTPTarget
		 found in method PageUpdated
		 in type Com.Rttp.Rtjl.Subscriber.IUniqueRTTPSubscriber
:  warning BG8801: Invalid parameter type com.rttp.rtjl.UniqueRTTPTarget
		 found in method PageUpdated
		 in type Com.Rttp.Rtjl.Subscriber.IUniqueRTTPSubscriber
:  warning BG8801: Invalid parameter type com.rttp.rtjl.UniqueRTTPTarget
		 found in method PermissionCleared
		 in type Com.Rttp.Rtjl.Subscriber.IUniqueRTTPSubscriber
:  warning BG8801: Invalid parameter type com.rttp.rtjl.UniqueRTTPTarget
		 found in method PermissionDeleted
		 in type Com.Rttp.Rtjl.Subscriber.IUniqueRTTPSubscriber
:  warning BG8801: Invalid parameter type com.rttp.rtjl.UniqueRTTPTarget
		 found in method PermissionUpdated
		 in type Com.Rttp.Rtjl.Subscriber.IUniqueRTTPSubscriber
:  warning BG8801: Invalid parameter type com.rttp.rtjl.UniqueRTTPTarget
		 found in method RecordUpdated
		 in type Com.Rttp.Rtjl.Subscriber.IUniqueRTTPSubscriber
:  warning BG8801: Invalid parameter type com.rttp.rtjl.UniqueRTTPTarget
		 found in method StoryUpdated
		 in type Com.Rttp.Rtjl.Subscriber.IUniqueRTTPSubscriber
:  warning BG8801: Invalid parameter type com.rttp.rtjl.UniqueRTTPTarget
		 found in method Type1FieldsCleared
		 in type Com.Rttp.Rtjl.Subscriber.IUniqueRTTPSubscriber
:  warning BG8801: Invalid parameter type com.rttp.rtjl.UniqueRTTPTarget
		 found in method Type2EntriesCleared
		 in type Com.Rttp.Rtjl.Subscriber.IUniqueRTTPSubscriber
:  warning BG8801: Invalid parameter type com.rttp.rtjl.UniqueRTTPTarget
		 found in method Type2EntryDeleted
		 in type Com.Rttp.Rtjl.Subscriber.IUniqueRTTPSubscriber
:  warning BG8801: Invalid parameter type com.rttp.rtjl.UniqueRTTPTarget
		 found in method Type2RecordUpdated
		 in type Com.Rttp.Rtjl.Subscriber.IUniqueRTTPSubscriber
:  warning BG8801: Invalid parameter type com.rttp.rtjl.UniqueRTTPTarget
		 found in method Type3EntriesCleared
		 in type Com.Rttp.Rtjl.Subscriber.IUniqueRTTPSubscriber
:  warning BG8801: Invalid parameter type com.rttp.rtjl.UniqueRTTPTarget
		 found in method Type3RecordUpdated
		 in type Com.Rttp.Rtjl.Subscriber.IUniqueRTTPSubscriber
:  warning BG8503: Invalidating Com.Rttp.Rtjl.Subscriber.IUniqueRTTPSubscriber and all nested types because some of its methods were invalid
:  warning BG8C00: For type Com.Rttp.Rtjl.AbstractEventHandler, base interface com.rttp.rtjl.subscriber.UniqueRTTPSubscriber is invalid.
:  warning BG8801: Invalid parameter type com.rttp.rtjl.UniqueRTTPTarget
		 found in method ActionFailed
		 in type Com.Rttp.Rtjl.AbstractEventHandler
:  warning BG8801: Invalid parameter type com.rttp.rtjl.UniqueRTTPTarget
		 found in method ActiveRequest
		 in type Com.Rttp.Rtjl.AbstractEventHandler
:  warning BG8801: Invalid parameter type com.rttp.rtjl.UniqueRTTPTarget
		 found in method ChatUpdated
		 in type Com.Rttp.Rtjl.AbstractEventHandler
:  warning BG8801: Invalid parameter type com.rttp.rtjl.UniqueRTTPTarget
		 found in method ContributeOk
		 in type Com.Rttp.Rtjl.AbstractEventHandler
:  warning BG8801: Invalid parameter type com.rttp.rtjl.UniqueRTTPTarget
		 found in method CreateOk
		 in type Com.Rttp.Rtjl.AbstractEventHandler
:  warning BG8801: Invalid parameter type com.rttp.rtjl.UniqueRTTPTarget
		 found in method DeleteOk
		 in type Com.Rttp.Rtjl.AbstractEventHandler
:  warning BG8801: Invalid parameter type com.rttp.rtjl.UniqueRTTPTarget
		 found in method DirectoryUpdated
		 in type Com.Rttp.Rtjl.AbstractEventHandler

....

	obj/Debug/generated/src/Com.Rttp.Rtjl.Filter.RecordFilter.cs(99,43): warning CS0114: `Com.Rttp.Rtjl.Filter.RecordFilter.Clone()' hides inherited member `Java.Lang.Object.Clone()'. To make the current member override that implementation, add the override keyword. Otherwise add the new keyword
	obj/Debug/generated/src/Com.Rttp.Rtjl.ObjectAdapter.cs(17,4): warning CS0628: `Com.Rttp.Rtjl.ObjectAdapter.EventHandler.get': new protected member declared in sealed class
	obj/Debug/generated/src/Com.Rttp.Rtjl.ObjectAdapter.cs(23,4): warning CS0628: `Com.Rttp.Rtjl.ObjectAdapter.EventHandler.set': new protected member declared in sealed class
	obj/Debug/generated/src/Com.Rttp.Rtjl.ObjectAdapter.cs(16,52): warning CS0628: `Com.Rttp.Rtjl.ObjectAdapter.EventHandler': new protected member declared in sealed class
	obj/Debug/generated/src/Com.Rttp.Rtjl.SourceAdapter.cs(17,4): warning CS0628: `Com.Rttp.Rtjl.SourceAdapter.EventHandler.get': new protected member declared in sealed class
	obj/Debug/generated/src/Com.Rttp.Rtjl.SourceAdapter.cs(23,4): warning CS0628: `Com.Rttp.Rtjl.SourceAdapter.EventHandler.set': new protected member declared in sealed class
	obj/Debug/generated/src/Com.Rttp.Rtjl.SourceAdapter.cs(16,52): warning CS0628: `Com.Rttp.Rtjl.SourceAdapter.EventHandler': new protected member declared in sealed class

Errors:

/Users/abc/Projects/SLBindingLibrary/SLBindingLibrary/SLBindingLibrary.csproj (Build) ->
/Library/Frameworks/Mono.framework/Versions/3.2.0/lib/mono/4.0/Microsoft.CSharp.Targets (CoreCompile target) ->

	obj/Debug/generated/src/Com.Rttp.Rtjl.Chain.ChainRTTPTargetImpl.cs(9,73): error CS0234: The type or namespace name `ChainBodyRTTPTarget' does not exist in the namespace `Com.Rttp.Rtjl.Chain'. Are you missing an assembly reference?
	obj/Debug/generated/src/Com.Rttp.Rtjl.Chain.ChainRTTPTargetImpl.cs(18,29): error CS0115: `Com.Rttp.Rtjl.Chain.ChainRTTPTargetImpl.ThresholdClass' is marked as an override but no suitable property found to override
	obj/Debug/generated/src/Com.Rttp.Rtjl.Chain.ChainRTTPTargetImpl.cs(22,42): error CS0115: `Com.Rttp.Rtjl.Chain.ChainRTTPTargetImpl.ThresholdType' is marked as an override but no suitable property found to override
	obj/Debug/generated/src/Com.Rttp.Rtjl.Chain.ChainRTTPTargetImpl.cs(267,61): error CS0115: `Com.Rttp.Rtjl.Chain.ChainRTTPTargetImpl.ElementAt(int)' is marked as an override but no suitable method found to override

	 687 Warning(s)
	 4 Error(s)

Time Elapsed 00:00:08.5187910

---------------------- Done ----------------------

Build: 4 errors, 687 warnings
Comment 1 Atsushi Eno 2013-09-05 11:26:43 UTC
You cannot bind to a Java library (rtjl-4.4.14.jar) without having any corresponding managed type for dependent Java libraries (aelfred-4.4.14.jar, failover-4.4.14.jar and rttp-4.4.14.jar). In other words, those three libraries also need to be EmbeddedJar, or you have to build independent binding library dll and add references to those library dlls from this SLBindingLibrary project.
Comment 2 fkuciapa 2013-09-06 02:15:44 UTC
Makes sense. But there may be a bug with metadata.xml...

I have these 2 rules in place but compiler still complains about some FxDG violations... see below.

This still happens after modifying the jars to embeddedJars.

 <attr path="/api/package[@name='com.caplin.credentials']/class[@name='Credentials']" name="managedName">SLCredentials</attr>
 <attr path="/api/package[@name='com.caplin.util.random']/class[@name='Random']" name="managedName">SLRandom</attr>


:  warning BG8900: Type com.caplin.credentials.Credentials: FxDG naming
violation: Type name 'Credentials' matches namespace part 'Credentials'.
:  warning BG8900: Type com.caplin.util.random.Random: FxDG naming violation:
Type name 'Random' matches namespace part 'Random'.
Comment 3 Atsushi Eno 2013-09-06 04:29:50 UTC
Oh, indeed that gives false alarm on the correct metadata, that needs to be cleaned up. So far the warnings does not result in any side effect, just checking the name, so you can safely fix other build errors without concern around it.
Comment 7 Atsushi Eno 2013-09-06 07:48:48 UTC
Of course binding classes need to have extra members that are dedicated to work on mono.

You are not supposed to bind obfuscated classes. They are not supposed to be invoked outside the library itself, hence they are not bound.
Comment 8 fkuciapa 2013-09-06 09:01:54 UTC
Thanks Atsushi. 

1. But how is this supposed to compile if the bound code references a class that has been obfuscated and which is excluded from binding in Xamarin ????

2. I suppose according to docs, I can make an obfuscated class included by the above directive. This is not working ? or is not supposed to work...

Kind of crazy with this library :)
Comment 9 Atsushi Eno 2013-09-09 11:22:56 UTC
1. Use <remove-node> to remove any public member that references the obfuscated type, *if any*. Such types or members are supposed to not be generated though.

2. You "can" but we don't assure anything about it. It may not work.

I assume you want @name='d' instead of 'D' here:

<attr path="/api/package[@name='com.rttp.client']/class[@name='D']"
name="obfuscated">false</attr>