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

Fhl*_*Fhl 1 java binding visibility spotify xamarin

更新:感谢jgoldberger,我已经解决了

  <remove-node path="/api/package[@name='com.spotify.sdk.android.authentication']/interface[@name='AuthenticationClient.AuthenticationCompleteListener']" />
Run Code Online (Sandbox Code Playgroud)

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

在SDK中,类AuthenticationClient内有一个私有接口AuthenticationCompleteListener。

我尝试使用

<attr path="/api/package[@name='com.spotify.sdk.android.authentication']/class[@name='AuthenticationClient.AuthenticationCompleteListener']" name="visibility">public</attr>
Run Code Online (Sandbox Code Playgroud)

以及各种变化,包括

<attr path="/api/package[@name='com.spotify.sdk.android.authentication']/class[@name='AuthenticationClient']/interface[@name='AuthenticationCompleteListener']" name="visibility">public</attr>
Run Code Online (Sandbox Code Playgroud)

但是,构建时出现以下错误:

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

我能做什么?

感谢您对
弗雷德的帮助

jgo*_*SFT 5

如果那是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