Xamarin:Java绑定项目-无法更改本地接口的可见性



更新:多亏了jgoldberger,我用解决了这个问题

  <remove-node path="/api/package[@name='com.spotify.sdk.android.authentication']/interface[@name='AuthenticationClient.AuthenticationCompleteListener']" />

我正在尝试为Android Spotify SDK创建一个Java绑定项目。我已经使用Metadata.xml解决了大多数问题,但我无法解决最后一个问题。

在类AuthenticationClient内的SDK中,有一个专用接口AuthenticationCompleteListener。

我试过使用

<attr path="/api/package[@name='com.spotify.sdk.android.authentication']/class[@name='AuthenticationClient.AuthenticationCompleteListener']" name="visibility">public</attr>

以及包括在内的各种变体

<attr path="/api/package[@name='com.spotify.sdk.android.authentication']/class[@name='AuthenticationClient']/interface[@name='AuthenticationCompleteListener']" name="visibility">public</attr>

然而,我在构建时遇到以下错误:

错误:AuthenticationCompleteListener在中不是公共的AuthenticationClient;无法从程序包外部访问。

我能做什么?

谢谢你的帮助
Fred

如果这是Java库中的私有内部,我想您不需要从使用该库的项目访问它。如果是这样的话,您是否尝试过使用以下内容删除Metadata.xml文件中的接口:

<remove node path="/api/package[@name='com.spotify.sdk.android.authentication']/class[@name='AuthenticationClient.AuthenticationCompleteListener']"/>

或者(因为我不确定java库中实际的完全限定路径):

<remove node path="/api/package[@name='com.spotify.sdk.android.authentication']/class[@name='AuthenticationClient']/interface[@name='AuthenticationCompleteListener']"/>

此外,有时对Java库进行反编译并从路径上了解实际情况也很有帮助。在Mac上,我使用JD-GUI,它运行得很好。您只需在JD-GUI中打开.jar文件,就可以看到库的整个布局。http://mac.softpedia.com/get/Development/Java/JD-GUI.shtml

最新更新