Search code examples
intellij-ideaobfuscationyguard

When compiling a Yguard Ant target in IntelliJ, there is an Error: The <yguard> type doesn't support nested text data ("")


When compiling a Yguard Ant target in IntelliJ, there is an Error: "The <yguard> type doesn't support nested text data ("")". Any help on fixing the cause of this error would be greatly appreciated.

Here is the YGuard Ant Target:

<target  name="yguard">
        <taskdef name="yguard" classname="com.yworks.yguard.YGuardTask" classpath="yguard.jar"/>
        <yguard>
            <inoutpair in="/Users/user/IdeaProjects/java.jar" out="/Users/user/IdeaProjects/java_obf.jar"/>
        </yguard>
    </target>

Solution

  • The solution seems to be to change the encoding, to remove invisible characters that aren't being processed by the IDE, that come from copying and pasting. I pasted the code into komodo editor, changed the encoding to ISO-8859-1, then pasted it back into the build.xml and the error went away.

    There are is also more information on correcting this error:

    Convert DOS line endings to Linux line endings in vim

    Clean source code files of invisible characters

    https://superuser.com/questions/560014/vim-remove-bad-hidden-characters