首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >找到的xamarin.android绑定参数超过16个

找到的xamarin.android绑定参数超过16个
EN

Stack Overflow用户
提问于 2017-08-02 16:01:53
回答 1查看 298关注 0票数 0

在此处绑定项目:https://1drv.ms/u/s!AiLsd2NKfovHm-sbwI-iFUTFI1Z-HQ

在使用vs构建它之后,它将显示以下错误:

发现超过16个参数,超出了参数的最大数量...

在此处构建输出:

代码语言:javascript
复制
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 ==========
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2017-08-04 01:17:20

我相信在这种情况下的正确方法是在Android Studio中创建一个包装器jar,然后您可以绑定到少于16个参数的jar。16个参数已经有了足够的代码嗅觉。绑定生成器实际上对此进行了验证:

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

我认为这个限制来自于Func和Action委托

Why don't Funcs accept more than 16 arguments?

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

另一种方法是直接使用JNI:

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

例如:

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

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

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/45454926

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档