未生成Java绑定抽象类 [英] Java Binding Abstract class not being generated

查看:97
本文介绍了未生成Java绑定抽象类的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

错误CS0234:类型或名称空间名称IBitmap' does not exist in the namespace Com.Sushi.Hangover'.您是否缺少装配参考?

Error CS0234: The type or namespace name IBitmap' does not exist in the namespaceCom.Sushi.Hangover'. Are you missing an assembly reference?

我有一个Android绑定项目,该项目具有从多个接口继承的类,但是这些接口没有生成,因此依赖它们的所有公共类都无法绑定.

I have an Android binding project which has classes that are inheriting from multiple interfaces but these interfaces are not been generated and thus all of the public classes that depend upon them are failing to bind.

abstract interface Bitmap
{
   ~~~ (methods removed)
}

api.xml:

<interface abstract="true" deprecated="not deprecated" final="false" name="Bitmap" static="false" visibility="">

如您所见,此接口的visibility未设置为public,因此没有生成C#代码,但是开始生成依赖于此接口的公共类:

As you can see the visibility of this interface is not set to public and thus no C# code is generated, but there are public classes begin generated that depend on this interface:

public partial class DrawableDesign : global::Com.Sushi.Hangover.IBitmap {

绑定将接口名称从Bitmap转换为IBitmap时就知道了该接口.

The binding is aware of the interface as it transforming the interface name from Bitmap to IBitmap.

是否有任何方法可以强制创建这些接口而无需返回Java代码并将这些接口更改为公共接口,以将它们作为visibility="public"进入api.xml?

注意:由于此客户端没有Alpha/Beta访问权限,因此我处于稳定频道(Xamarin.Android版本:6.0.3.5)

Note: I am on stable channel (Xamarin.Android Version: 6.0.3.5) as this client does not have Alpha/Beta access

推荐答案

我为此主题写了一个小指南,可能对某些领域有所帮助:

I've written a smallish guide on this topic that might help in certain areas: https://gist.github.com/JonDouglas/dda6d8ace7d071b0e8cb

简而言之,您可以尝试更改@Cheesebaron已经提到的可见性: https ://gist.github.com/JonDouglas/dda6d8ace7d071b0e8cb#class-visibility (用界面替换/class或读取公共路径)

In short, you could potentially try changing the visibility like @Cheesebaron has mentioned already: https://gist.github.com/JonDouglas/dda6d8ace7d071b0e8cb#class-visibility (Replace /class with interface or read the common paths)

否则,您可能会尝试从头开始添加节点: https://gist. github.com/JonDouglas/dda6d8ace7d071b0e8cb#adding-types

Otherwise you can potentially try to add the node from scratch: https://gist.github.com/JonDouglas/dda6d8ace7d071b0e8cb#adding-types

要获得更准确的答案,我相信我们需要查看各自的.jar/.aar和当前的Bindings项目.

For a more exact answer, I believe we would need to see the respective .jar/.aar and the current Bindings project.

这篇关于未生成Java绑定抽象类的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆