Bug 58557 - More than 16 parameters were found, which goes beyond the maximum number of parameters.
Summary: More than 16 parameters were found, which goes beyond the maximum number of p...
Status: CONFIRMED
Alias: None
Product: Android
Classification: Xamarin
Component: Bindings ()
Version: 7.3 (15.2)
Hardware: PC Windows
: --- normal
Target Milestone: ---
Assignee: Atsushi Eno
URL:
Depends on:
Blocks:
 
Reported: 2017-08-03 01:43 UTC by ericcui
Modified: 2017-08-03 17:22 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 for Bug 58557 on Developer Community or GitHub if you have new information to add and do not yet see a matching new report.

If the latest results still closely match this report, you can use the original description:

  • Export the original title and description: Developer Community HTML or GitHub Markdown
  • Copy the title and description into the new report. Adjust them to be up-to-date if needed.
  • Add your new information.

In special cases on GitHub you might also want the comments: GitHub Markdown with public comments

Related Links:
Status:
CONFIRMED

Description ericcui 2017-08-03 01:43:04 UTC
There is seem like that the vs' compiler can not complier the java method which has more than 16 parameter.
and the java method is in the 3rd party library (baidu map api kit 4.3.2,the binding project had shared in my 1drive here: https://1drv.ms/u/s!AiLsd2NKfovHm-sbwI-iFUTFI1Z-HQ )

same detail discuss in stackoverflow : 
https://stackoverflow.com/questions/45454926/xamarin-android-binding-more-than-16-parameters-were-found

there is the build output (look at this in 3rd line):

1>------ Rebuild All started: Project: BaiduLBSAndroidSDKBindingV_4_3_2, Configuration: Debug Any CPU ------
1>JARTOXML : Java HotSpot(TM) 64-Bit Server VM warning : ignoring option UseSplitVerifier; support was removed in 8.0
1>BINDINGSGENERATOR : warning BG8D00: More than 16 parameters were found, which goes beyond the maximum number of parameters. (in method Init in managed type Com.Baidu.Platform.Comjni.Map.Basemap.JNIBaseMap)
1>BINDINGSGENERATOR : warning BG8103: Class Com.Baidu.Mapapi.Map.WeightedLatLng has invalid base type com.baidu.mapapi.map.l.a.
1>BINDINGSGENERATOR : warning BG8801: Invalid parameter type java.util.Collection<com.baidu.mapapi.map.WeightedLatLng> in method WeightedData in managed type Com.Baidu.Mapapi.Map.HeatMap.Builder.
1>D:\TempApps\BaiduLBSAndroidSDKBindingV_4_3_2\BaiduLBSAndroidSDKBindingV_4_3_2\obj\Debug\generated\src\Com.Baidu.Platform.Comapi.Map.E.cs(1274,19,1274,30): error CS0111: Type 'E' already defines a member called 'GetCHandler' with the same parameter types
1>D:\TempApps\BaiduLBSAndroidSDKBindingV_4_3_2\BaiduLBSAndroidSDKBindingV_4_3_2\obj\Debug\generated\src\Com.Baidu.Platform.Comapi.Map.E.cs(1281,15,1281,18): error CS0111: Type 'E' already defines a member called 'n_C' with the same parameter types
1>D:\TempApps\BaiduLBSAndroidSDKBindingV_4_3_2\BaiduLBSAndroidSDKBindingV_4_3_2\obj\Debug\generated\src\Com.Baidu.Platform.Comapi.Map.E.cs(1291,30,1291,31): error CS0111: Type 'E' already defines a member called 'C' with the same parameter types
1>D:\TempApps\BaiduLBSAndroidSDKBindingV_4_3_2\BaiduLBSAndroidSDKBindingV_4_3_2\obj\Debug\generated\src\Com.Baidu.Platform.Comapi.Map.E.cs(1378,19,1378,30): error CS0111: Type 'E' already defines a member called 'GetDHandler' with the same parameter types
1>D:\TempApps\BaiduLBSAndroidSDKBindingV_4_3_2\BaiduLBSAndroidSDKBindingV_4_3_2\obj\Debug\generated\src\Com.Baidu.Platform.Comapi.Map.E.cs(1385,15,1385,18): error CS0111: Type 'E' already defines a member called 'n_D' with the same parameter types
1>D:\TempApps\BaiduLBSAndroidSDKBindingV_4_3_2\BaiduLBSAndroidSDKBindingV_4_3_2\obj\Debug\generated\src\Com.Baidu.Platform.Comapi.Map.E.cs(1395,30,1395,31): error CS0111: Type 'E' already defines a member called 'D' with the same parameter types
1>D:\TempApps\BaiduLBSAndroidSDKBindingV_4_3_2\BaiduLBSAndroidSDKBindingV_4_3_2\obj\Debug\generated\src\Com.Baidu.Platform.Comapi.Map.E.cs(1552,19,1552,30): error CS0111: Type 'E' already defines a member called 'GetGHandler' with the same parameter types
1>D:\TempApps\BaiduLBSAndroidSDKBindingV_4_3_2\BaiduLBSAndroidSDKBindingV_4_3_2\obj\Debug\generated\src\Com.Baidu.Platform.Comapi.Map.E.cs(1559,15,1559,18): error CS0111: Type 'E' already defines a member called 'n_G' with the same parameter types
1>D:\TempApps\BaiduLBSAndroidSDKBindingV_4_3_2\BaiduLBSAndroidSDKBindingV_4_3_2\obj\Debug\generated\src\Com.Baidu.Platform.Comapi.Map.E.cs(1569,30,1569,31): error CS0111: Type 'E' already defines a member called 'G' with the same parameter types
1>D:\TempApps\BaiduLBSAndroidSDKBindingV_4_3_2\BaiduLBSAndroidSDKBindingV_4_3_2\obj\Debug\generated\src\Com.Baidu.Platform.Comapi.Map.E.cs(1620,19,1620,30): error CS0111: Type 'E' already defines a member called 'GetHHandler' with the same parameter types
1>D:\TempApps\BaiduLBSAndroidSDKBindingV_4_3_2\BaiduLBSAndroidSDKBindingV_4_3_2\obj\Debug\generated\src\Com.Baidu.Platform.Comapi.Map.E.cs(1627,17,1627,20): error CS0111: Type 'E' already defines a member called 'n_H' with the same parameter types
1>D:\TempApps\BaiduLBSAndroidSDKBindingV_4_3_2\BaiduLBSAndroidSDKBindingV_4_3_2\obj\Debug\generated\src\Com.Baidu.Platform.Comapi.Map.E.cs(1637,32,1637,33): error CS0111: Type 'E' already defines a member called 'H' with the same parameter types
1>D:\TempApps\BaiduLBSAndroidSDKBindingV_4_3_2\BaiduLBSAndroidSDKBindingV_4_3_2\obj\Debug\generated\src\Com.Baidu.Platform.Comapi.Map.E.cs(1688,19,1688,30): error CS0111: Type 'E' already defines a member called 'GetIHandler' with the same parameter types
1>D:\TempApps\BaiduLBSAndroidSDKBindingV_4_3_2\BaiduLBSAndroidSDKBindingV_4_3_2\obj\Debug\generated\src\Com.Baidu.Platform.Comapi.Map.E.cs(1695,15,1695,18): error CS0111: Type 'E' already defines a member called 'n_I' with the same parameter types
1>D:\TempApps\BaiduLBSAndroidSDKBindingV_4_3_2\BaiduLBSAndroidSDKBindingV_4_3_2\obj\Debug\generated\src\Com.Baidu.Platform.Comapi.Map.E.cs(1705,30,1705,31): error CS0111: Type 'E' already defines a member called 'I' with the same parameter types
1>D:\TempApps\BaiduLBSAndroidSDKBindingV_4_3_2\BaiduLBSAndroidSDKBindingV_4_3_2\obj\Debug\generated\src\Com.Baidu.Platform.Comapi.Map.E.cs(1756,19,1756,30): error CS0111: Type 'E' already defines a member called 'GetJHandler' with the same parameter types
1>D:\TempApps\BaiduLBSAndroidSDKBindingV_4_3_2\BaiduLBSAndroidSDKBindingV_4_3_2\obj\Debug\generated\src\Com.Baidu.Platform.Comapi.Map.E.cs(1763,15,1763,18): error CS0111: Type 'E' already defines a member called 'n_J' with the same parameter types
1>D:\TempApps\BaiduLBSAndroidSDKBindingV_4_3_2\BaiduLBSAndroidSDKBindingV_4_3_2\obj\Debug\generated\src\Com.Baidu.Platform.Comapi.Map.E.cs(1773,30,1773,31): error CS0111: Type 'E' already defines a member called 'J' with the same parameter types
========== Rebuild All: 0 succeeded, 1 failed, 0 skipped ==========
Comment 1 Jon Douglas [MSFT] 2017-08-03 17:22:50 UTC
I believe the correct approach in this situation is to create a wrapper jar in Android Studio that you can then bind to which has less than 16 parameters. 16 parameters already has enough code smell as it is. The binding generator actually validates against this:

https://github.com/xamarin/java.interop/blob/master/tools/generator/MethodBase.cs#L194-L196

The limit I believe comes from Func and Action delegates

https://stackoverflow.com/questions/7564027/why-dont-funcs-accept-more-than-16-arguments

i.e.

https://msdn.microsoft.com/en-us/library/dd402862(v=vs.110).aspx

Another approach would be to directly work with the JNI:

https://developer.xamarin.com/guides/android/advanced_topics/java_integration_overview/working_with_jni/

EX: 

https://gist.github.com/mattleibow/2a7379294b8d59b6726891412b58445c

https://gist.github.com/mattleibow/f1cef8feed89f5d540b4d31cfc36b259

I will change this bug to "Confirmed" for our bindings engineer to confirm the behavior and indicate the limitation.