.NET for Android 錯誤 XA1046

範例訊息

error XA1046: Attribute 'target-method-instance-to-static' in element 'replace-method' has value 'yes' that cannot be parsed as boolean; /path/to/jni-remapping.xml line 5.

Issue

target-method-instance-to-static JNI 重映射 XML 檔案中元素<replace-method>的屬性包含無法解析為布林值的值。 該屬性需要一個有效的布林值,例如 truefalse或 。

解決方案

更新你的 JNI 重映射 XML 檔案中的 target-method-instance-to-static 屬性,使其使用有效的布林值(true 或 false):

<replacements>
  <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>