我正在尝试绑定本机 Java 库。此 jar 文件以前已集成到绑定项目中,我正在尝试使用最新版本更新 jar。
我在构建过程中遇到以下问题:
1>obj\Debug\android\src\md5590cc678a2a3d84b78a3968f92c9e08f\cemListener.java:81: error: cannot find symbol
1> public void deferredAuthorization (boolean p0, boolean p1, com.creditcall.cardeasemobile.DeferredAuthorizationReason p2)
1> ^
1> symbol: class DeferredAuthorizationReason
1> location: package com.creditcall.cardeasemobile
1>obj\Debug\android\src\md5590cc678a2a3d84b78a3968f92c9e08f\cemListener.java:86: error: cannot find symbol
1> private native void n_deferredAuthorization (boolean p0, boolean p1, com.creditcall.cardeasemobile.DeferredAuthorizationReason p2);
1> ^
1> symbol: class DeferredAuthorizationReason
1> location: package com.creditcall.cardeasemobile
1>D:\repo\a\Payment\obj\Debug\android\src\md5590cc678a2a3d84b78a3968f92c9e08f\cemListener.java(81,90): javac.exe error : error: cannot find symbol
1>D:\repo\a\Payment\obj\Debug\android\src\md5590cc678a2a3d84b78a3968f92c9e08f\cemListener.java(81,90): javac.exe error : public void deferredAuthorization (boolean p0, boolean p1, com.creditcall.cardeasemobile.DeferredAuthorizationReason p2)
1>D:\repo\a\Payment\obj\Debug\android\src\md5590cc678a2a3d84b78a3968f92c9e08f\cemListener.java(81,90): javac.exe error : symbol: class DeferredAuthorizationReason
1>D:\repo\a\Payment\obj\Debug\android\src\md5590cc678a2a3d84b78a3968f92c9e08f\cemListener.java(81,90): javac.exe error : location: package com.creditcall.cardeasemobile
1>D:\repo\a\Payment\obj\Debug\android\src\md5590cc678a2a3d84b78a3968f92c9e08f\cemListener.java(81,90): javac.exe error :
1>D:\repo\a\Payment\obj\Debug\android\src\md5590cc678a2a3d84b78a3968f92c9e08f\cemListener.java(86,100): javac.exe error : error: cannot find symbol
1>D:\repo\a\Payment\obj\Debug\android\src\md5590cc678a2a3d84b78a3968f92c9e08f\cemListener.java(86,100): javac.exe error : private native void n_deferredAuthorization (boolean p0, boolean p1, com.creditcall.cardeasemobile.DeferredAuthorizationReason p2);
1>D:\repo\a\Payment\obj\Debug\android\src\md5590cc678a2a3d84b78a3968f92c9e08f\cemListener.java(86,100): javac.exe error : symbol: class DeferredAuthorizationReason
1>D:\repo\a\Payment\obj\Debug\android\src\md5590cc678a2a3d84b78a3968f92c9e08f\cemListener.java(86,100): javac.exe error : location: package com.creditcall.cardeasemobile
1>D:\repo\a\Payment\obj\Debug\android\src\md5590cc678a2a3d84b78a3968f92c9e08f\cemListener.java(86,100): javac.exe error :
1>D:\repo\a\Payment\obj\Debug\android\src\mono\com\creditcall\cardeasemobile\ICardEaseMobileListenerImplementor.java(81,90): javac.exe error : error: cannot find symbol
1>D:\repo\a\Payment\obj\Debug\android\src\mono\com\creditcall\cardeasemobile\ICardEaseMobileListenerImplementor.java(81,90): javac.exe error : public void deferredAuthorization (boolean p0, boolean p1, com.creditcall.cardeasemobile.DeferredAuthorizationReason p2)
1>D:\repo\a\Payment\obj\Debug\android\src\mono\com\creditcall\cardeasemobile\ICardEaseMobileListenerImplementor.java(81,90): javac.exe error : symbol: class DeferredAuthorizationReason
1>D:\repo\a\Payment\obj\Debug\android\src\mono\com\creditcall\cardeasemobile\ICardEaseMobileListenerImplementor.java(81,90): javac.exe error : location: package com.creditcall.cardeasemobile
1>D:\repo\a\Payment\obj\Debug\android\src\mono\com\creditcall\cardeasemobile\ICardEaseMobileListenerImplementor.java(81,90): javac.exe error :
1>D:\repo\a\Payment\obj\Debug\android\src\mono\com\creditcall\cardeasemobile\ICardEaseMobileListenerImplementor.java(86,100): javac.exe error : error: cannot find symbol
1>D:\repo\a\Payment\obj\Debug\android\src\mono\com\creditcall\cardeasemobile\ICardEaseMobileListenerImplementor.java(86,100): javac.exe error : private native void n_deferredAuthorization (boolean p0, boolean p1, com.creditcall.cardeasemobile.DeferredAuthorizationReason p2);
1>D:\repo\a\Payment\obj\Debug\android\src\mono\com\creditcall\cardeasemobile\ICardEaseMobileListenerImplementor.java(86,100): javac.exe error : symbol: class DeferredAuthorizationReason
1>D:\repo\a\Payment\obj\Debug\android\src\mono\com\creditcall\cardeasemobile\ICardEaseMobileListenerImplementor.java(86,100): javac.exe error : location: package com.creditcall.cardeasemobile
1>D:\repo\a\Payment\obj\Debug\android\src\mono\com\creditcall\cardeasemobile\ICardEaseMobileListenerImplementor.java(86,100): javac.exe error :
我可以在以下位置看到这些方法cemListener.java
:
public void deferredAuthorization (boolean p0, boolean p1, com.creditcall.cardeasemobile.DeferredAuthorizationReason p2)
{
n_deferredAuthorization (p0, p1, p2);
}
private native void n_deferredAuthorization (boolean p0, boolean p1, com.creditcall.cardeasemobile.DeferredAuthorizationReason p2);
我可以看到它DeferredAuthorizationReason
存在并且具有可从我的 C# 文件访问的值。好像绑定成功了?我认为问题是由于某种原因cemListener.java
看不到。DeferredAuthorizationReason
我认为我需要对 Metadata.xml 进行更改,但我不确定需要什么,因为问题似乎出在 java 文件中而不是 C# 中。
这是 api.xml 中的类:
<class abstract="false"
deprecated="not deprecated"
extends="java.lang.Enum"
extends-generic-aware="java.lang.Enum<com.creditcall.cardeasemobile.DeferredAuthorizationReason>"
final="true"
name="DeferredAuthorizationReason"
static="false"
visibility="public">
<method abstract="false"
deprecated="not deprecated"
final="false"
name="valueOf"
native="false"
return="com.creditcall.cardeasemobile.DeferredAuthorizationReason"
static="true"
synchronized="false"
visibility="public">
<parameter name="p0"
type="java.lang.String">
</parameter>
</method>
<method abstract="false" deprecated="not deprecated" final="false" name="values" native="false" return="com.creditcall.cardeasemobile.DeferredAuthorizationReason[]" static="true" synchronized="false" visibility="public">
</method>
<field deprecated="not deprecated" final="true" name="CommunicationFailed" static="true" transient="false" type="com.creditcall.cardeasemobile.DeferredAuthorizationReason" type-generic-aware="com.creditcall.cardeasemobile.DeferredAuthorizationReason" visibility="public" volatile="false">
</field>
<field deprecated="not deprecated" final="true" name="ConnectionFailed" static="true" transient="false" type="com.creditcall.cardeasemobile.DeferredAuthorizationReason" type-generic-aware="com.creditcall.cardeasemobile.DeferredAuthorizationReason" visibility="public" volatile="false">
</field>
<field deprecated="not deprecated" final="true" name="None" static="true" transient="false" type="com.creditcall.cardeasemobile.DeferredAuthorizationReason" type-generic-aware="com.creditcall.cardeasemobile.DeferredAuthorizationReason" visibility="public" volatile="false">
</field>
<field deprecated="not deprecated" final="true" name="ProcessingFailed" static="true" transient="false" type="com.creditcall.cardeasemobile.DeferredAuthorizationReason" type-generic-aware="com.creditcall.cardeasemobile.DeferredAuthorizationReason" visibility="public" volatile="false">
</field>
</class>
我可以看到其他似乎没有引起问题的枚举,除了这个文件之外,我看不出这个有什么不同static="false"
。
我已经尝试在 Metadata.xml 中对此进行修改,但似乎没有效果:
<attr path="/api/package[@name='com.creditcall.cardeasemobile']/class[@name='DeferredAuthorizationReason']" name="static">true</attr>