メッセージの例
error XA1047: Required attribute 'from' missing from element 'replace-type'; /path/to/jni-remapping.xml line 3.
error XA1047: Required attribute 'source-type' missing from element 'replace-method'; /path/to/jni-remapping.xml line 7.
Issue
JNI 再マップ XML ファイル内の要素に必要な属性がありません。
<replace-type>要素と<replace-method>要素には、それぞれ必要な属性が存在する必要があります。
<replace-type>に必要な属性:
-
from— 元のJava型名 (例:com/example/OldClass) -
to— 置換Java型名 (例:com/example/NewClass)
<replace-method>に必要な属性:
-
source-type— 元のメソッドを含むJava型 -
source-method-name— 元のメソッドの名前 -
target-type— 置換メソッドを含むJava型 -
target-method-name— 置換メソッドの名前 -
target-method-instance-to-static— 置換によってインスタンス メソッドが静的メソッドに変換されるかどうか (trueまたはfalse)
ソリューション
不足している必要な属性を JNI 再マップ XML ファイル内の要素に追加します。 例えば次が挙げられます。
<replacements>
<replace-type from="com/example/OldClass" to="com/example/NewClass" />
<replace-method
source-type="com/example/Source"
source-method-name="instanceMethod"
target-type="com/example/Target"
target-method-name="staticMethod"
target-method-instance-to-static="true" />
</replacements>