×

Discussion Board

Results 1 to 5 of 5
  1. #1
    Registered User
    Join Date
    Dec 2008
    Posts
    3

    Smile [HELP]eclipse build failed, preverification failed

    Hello,
    I have a problem with my build.xml in eclipse. Each time, proGuard failed to obsfuscate... In eclipse, there's no error messages, just "build failed". Here following my build.xml.
    I was blocked since two weeks, can't find the solution. Anyone could help me? Thanks!

    <project name="test1" default="compile-real-master">
    <taskdef resource="antenna.properties" classpath="C:\Program Files\Java\jdk1.6.0_01\lib\antenna-bin-0.9.14.jar"/>
    <property name="wtk.home" value="C:\WTK25"/>
    <property name="wtk.proguard.home" value="C:\proguard4.2"/>
    <property name="wtk.bluetooth.enabled" value="true" />
    <property name="wtk.midp.version" value="2.0" />
    <property name="wtk.cldc.version" value="1.1" />
    <property name="wtk.libs" value="${wtk.home}/lib"/>
    <property name="additional.libs" value="${wtk.libs}"/>
    <property name="app.name" value="MYHT_emulator"/>
    <property name="app.midlet" value="org.ugasp.demonstrator.client.App"/>

    <!--<property name="prototype.sdk.home" value="C:\backup\GASP\rfid\JSR_257_RI_1_0a\JSR_257_RI_1_0\Prototype_3_0_S40_128x128_MIDP_Emulator"/>-->

    <!--<property name="boot.classpath" value="${wtk.home}/lib/cldcapi11.zip"/>-->
    <property name="classpath" value="${wtk.libs}\cldcapi11.jar;${wtk.libs}/midpapi20.jar;${wtk.libs}/jsr082.jar;${wtk.libs}/jsr179.jar;${wtk.libs}/jsr75.jar;${additional.libs}/mobileajax.jar" />

    <target name="preproc-test">
    <wtkpreprocess srcdir="src" destdir="src" symbols="${symbols}" verbose="true"/>
    </target>

    <target name="preproc-real">
    <wtkpreprocess srcdir="src" destdir="src" symbols="${symbols}" verbose="true"/>
    </target>

    <target name="compile-test-master">
    <property name="suffix" value="master"/>
    <property name="symbols" value="COMPILE_TEST,GAME_MASTER"/>
    <antcall target="preproc-test"/>
    <antcall target="compile"/>
    </target>

    <target name="compile-test-player">
    <property name="suffix" value="player"/>
    <property name="symbols" value="COMPILE_TEST"/>
    <antcall target="preproc-test"/>
    <antcall target="compile"/>
    </target>

    <target name="compile-real-master">
    <property name="suffix" value="master"/>
    <property name="symbols" value="COMPILE_REAL,GAME_MASTER"/>
    <antcall target="preproc-real"/>
    <antcall target="compile"/>
    </target>

    <target name="compile-real-player">
    <property name="suffix" value="player"/>
    <property name="symbols" value="COMPILE_REAL"/>
    <antcall target="preproc-real"/>
    <antcall target="compile"/>
    </target>

    <target name="compile">
    <echo message="${classpath}"/>
    <delete file="${app.name}_nonobfuscated.jar"/>
    <delete file="${app.name}_${suffix}.jad"/>
    <delete file="${app.name}_${suffix}.jar"/>

    <delete dir="preverified"/>
    <mkdir dir="preverified"/>
    <wtkbuild srcdir="src" destdir="preverified" preverify="true" bootclasspath="${classpath}" cldc="true"/>

    <wtkjad jadfile="${app.name}_${suffix}.jad"
    jarfile="${app.name}_${suffix}.jar"
    name="${app.name}"
    vendor="CNAM"
    version="1.0.0" >
    <midlet name="${app.name}" class="${app.midlet}" />
    <!-- <midlet name="NFCPeer" class="NFCPeer" />
    <attribute name="MIDlet-Push-1" value="ndef:rtd?name=U, ${app.midlet}, *"/>
    <attribute name="MIDlet-Permissions" value="javax.microedition.io.PushRegistry"/>-->
    </wtkjad>
    <wtkpackage jarfile="${app.name}_${suffix}.jar" jadfile="${app.name}_${suffix}.jad" obfuscate="true" preverify="true">
    <fileset dir="preverified"/>
    <fileset dir="resources" includes="*.*"/>
    </wtkpackage>
    </target>

    <target name="obfuscate">
    <wtkobfuscate jarfile="${app.name}.jar" jadfile="${app.name}.jad" obfuscator="proguard">
    <preserve class="org.ugasp.demonstrator.client.App"/>

    <argument value="-overloadaggressively"/>
    <argument value="-repackageclasses ''"/> <!--add by chen>-->
    <argument value="-allowaccessmodification"/>
    <argument value="-microedition"/> <!--add by chen>-->
    <argument value="-dontusemixedcaseclassnames"/> <!--add by chen>-->
    <argument value="-assumenosideeffects public class java.lang.Throwable {public void printStackTrace();}"/>
    <argument value="-assumenosideeffects public class java.lang.StringBuffer {public StringBuffer();public StringBuffer(int);public StringBuffer(java.lang.String);public java.lang.String toString();public char charAt(int);public int capacity();public int indexOf(java.lang.String,int);public int lastIndexOf(java.lang.String);public int lastIndexOf(java.lang.String,int);public int length();public java.lang.StringBuffer reverse();public java.lang.String substring(int);public java.lang.String substring(int,int);}"/>
    <argument value="-assumenosideeffects public class java.lang.String {public String();public String(byte[]);public String(byte[],int);public String(byte[],int,int);public String(byte[],int,int,int);public String(byte[],int,int,java.lang.String);public String(byte[],java.lang.String);public String(char[]);public String(char[],int,int);public String(java.lang.String);public String(java.lang.StringBuffer);public static java.lang.String copyValueOf(char[]);public static java.lang.String copyValueOf(char[],int,int);public static java.lang.String valueOf(boolean);public static java.lang.String valueOf(char);public static java.lang.String valueOf(char[]);public static java.lang.String valueOf(char[],int,int);public static java.lang.String valueOf(double);public static java.lang.String valueOf(float);public static java.lang.String valueOf(int);public static java.lang.String valueOf(java.lang.Object);public static java.lang.String valueOf(long);public boolean contentEquals(java.lang.StringBuffer);public boolean endsWith(java.lang.String);public boolean equalsIgnoreCase(java.lang.String);public boolean equals(java.lang.Object);public boolean matches(java.lang.String);public boolean regionMatches(boolean,int,java.lang.String,int,int);public boolean regionMatches(int,java.lang.String,int,int);public boolean startsWith(java.lang.String);public boolean startsWith(java.lang.String,int);public byte[] getBytes();public byte[] getBytes(java.lang.String);public char charAt(int);public char[] toCharArray();public int compareToIgnoreCase(java.lang.String);public int compareTo(java.lang.Object);public int compareTo(java.lang.String);public int hashCode();public int indexOf(int);public int indexOf(int,int);public int indexOf(java.lang.String);public int indexOf(java.lang.String,int);public int lastIndexOf(int);public int lastIndexOf(int,int);public int lastIndexOf(java.lang.String);public int lastIndexOf(java.lang.String,int);public int length();public java.lang.CharSequence subSequence(int,int);public java.lang.String concat(java.lang.String);public java.lang.String replaceAll(java.lang.String,java.lang.String);public java.lang.String replace(char,char);public java.lang.String replaceFirst(java.lang.String,java.lang.String);public java.lang.String[] split(java.lang.String);public java.lang.String[] split(java.lang.String,int);public java.lang.String substring(int);public java.lang.String substring(int,int);public java.lang.String toLowerCase();public java.lang.String toLowerCase(java.util.Locale);public java.lang.String toString();public java.lang.String toUpperCase();public java.lang.String toUpperCase(java.util.Locale);public java.lang.String trim();}"/>
    <argument value="-assumenosideeffects public class java.lang.System { public static native long currentTimeMillis();static java.lang.Class getCallerClass();public static native int identityHashCode(java.lang.Object);public static java.lang.SecurityManager getSecurityManager();public static java.util.Properties getProperties();public static java.lang.String getProperty(java.lang.String);public static java.lang.String getenv(java.lang.String);public static native java.lang.String mapLibraryName(java.lang.String);public static java.lang.String getProperty(java.lang.String,java.lang.String);}"/>
    <argument value="-assumenosideeffects public class java.lang.Thread {public static void dumpStack();}"/>
    </wtkobfuscate>
    </target>


    <target name="run-master">
    <exec executable="${wtk.home}/bin/emulator">
    <arg line="-classpath ${app.name}_master.jar" />
    <arg line="-Xdescriptor ${app.name}_master.jad" />
    <!-- arg line="-Xheapsize:8M"/> -->
    </exec>
    </target>

    <target name="run-player">
    <exec executable="${wtk.home}/bin/emulator">
    <arg line="-classpath ${app.name}_player.jar" />
    <arg line="-Xdescriptor ${app.name}_player.jad" />
    <!-- arg line="-Xheapsize:8M"/> -->
    </exec>
    </target>


    <!--<target name="run-master-player">
    <antcall target="compile-test-master"/>
    <antcall target="run-master"/>
    <antcall target="compile-test-player"/>
    <antcall target="run-player"/>
    </target>-->
    </project>

  2. #2
    Super Contributor
    Join Date
    Jun 2003
    Location
    Cheshire, UK
    Posts
    7,395

    Re: [HELP]eclipse build failed, preverification failed

    Hmmm... that's a lot of stuff...

    You say there is no error (just "build error") and that proguard fails to obfuscate. But your post subject says "preverifier error". What information do you get?

    What information do you get if you run from the command line?

    I would trim down that wtkobfuscate tag to:

    Code:
    <wtkobfuscate jarfile="${app.name}.jar" jadfile="${app.name}.jad"/>
    And make sure that works.

    Update your Antenna.

    Make sure that preverify.exe and jar.exe are both accessible through the PATH.

    Cheers,
    Graham.

  3. #3
    Registered User
    Join Date
    Dec 2008
    Posts
    3

    Re: [HELP]eclipse build failed, preverification failed

    Hi Graham,
    Thank you very much for your nice reply.
    I change the wtkobfuscate tag as you do;
    I update the antenna to antenna-bin-1.1.0-beta;
    I also verify that preverify.exe and jar.exe in PATH.
    But my build still doesn't work, it always comes the same messages as following; the last line marks the preverification is failed. and build failed. Do you have any idea from the build message? Thanks a lot.

    Buildfile: D:\01XiLabs\Projet_FeS\sources\test\build.xml
    compile-test-player:
    preproc-test:
    [wtkpreprocess] **************************************************************
    [wtkpreprocess] * Antenna 0.9.14 initialized for project "test1" *
    [wtkpreprocess] * Using Sun Wireless Toolkit 2.5 (CLDC-1.1; MIDP-2.0) *
    [wtkpreprocess] **************************************************************
    [wtkpreprocess] Preprocessing 30 file(s)
    [wtkpreprocess] org\ugasp\affective\simulator\AffectiveProvider.java ... not modified
    [wtkpreprocess] org\ugasp\demonstrator\AffectiveEvent.java ... not modified
    [wtkpreprocess] org\ugasp\demonstrator\ChatMessageBroadcast.java ... not modified
    [wtkpreprocess] org\ugasp\demonstrator\ChatMessageMulticast.java ... not modified
    [wtkpreprocess] org\ugasp\demonstrator\ChatMessageUnicast.java ... not modified
    [wtkpreprocess] org\ugasp\demonstrator\LobbyInfos.java ... not modified
    [wtkpreprocess] org\ugasp\demonstrator\LocationEvent.java ... not modified
    [wtkpreprocess] org\ugasp\demonstrator\MapRequest.java ... not modified
    [wtkpreprocess] org\ugasp\demonstrator\MyhtGameEvent.java ... not modified
    [wtkpreprocess] org\ugasp\demonstrator\NewPlayer.java ... not modified
    [wtkpreprocess] org\ugasp\demonstrator\PingPlayer.java ... not modified
    [wtkpreprocess] org\ugasp\demonstrator\UpdatePlayer.java ... not modified
    [wtkpreprocess] org\ugasp\demonstrator\client\App.java ... not modified
    [wtkpreprocess] org\ugasp\demonstrator\client\ApplicationInstanceInfos.java ... not modified
    [wtkpreprocess] org\ugasp\demonstrator\client\CustomTypes.java ... not modified
    [wtkpreprocess] org\ugasp\demonstrator\client\GASPClient.java ... not modified
    [wtkpreprocess] org\ugasp\demonstrator\client\IHMGasp.java ... not modified
    [wtkpreprocess] org\ugasp\demonstrator\client\MapCom.java ... not modified
    [wtkpreprocess] org\ugasp\demonstrator\client\NetworkCom.java ... not modified
    [wtkpreprocess] org\ugasp\demonstrator\client\game\Actor.java ... not modified
    [wtkpreprocess] org\ugasp\demonstrator\client\game\GameCanvas.java ... not modified
    [wtkpreprocess] org\ugasp\demonstrator\client\game\HeroeActor.java ... not modified
    [wtkpreprocess] org\ugasp\demonstrator\client\game\MultiplayerActor.java ... not modified
    [wtkpreprocess] org\ugasp\demonstrator\client\game\ResourcesManager.java ... not modified
    [wtkpreprocess] org\ugasp\demonstrator\client\game\SimpleGameCanvas.java ... not modified
    [wtkpreprocess] org\ugasp\location\bluetooth\Discovery.java ... not modified
    [wtkpreprocess] org\ugasp\location\bluetooth\GPSInfo.java ... not modified
    [wtkpreprocess] org\ugasp\location\jsr179\ConfigurationProvider.java ... not modified
    [wtkpreprocess] org\ugasp\location\jsr179\ProviderStatusListener.java ... not modified
    [wtkpreprocess] org\ugasp\location\simulator\GPSProvider.java ... not modified
    compile:
    [echo] C:\WTK25/lib\cldcapi11.jar;C:\WTK25/lib/midpapi20.jar;C:\WTK25/lib/jsr082.jar;C:\WTK25/lib/jsr179.jar;C:\WTK25/lib/jsr75.jar;C:\WTK25/lib/mobileajax.jar
    [delete] Deleting: D:\01XiLabs\Projet_FeS\sources\test\MYHT_emulator_player.jad
    [delete] Deleting: D:\01XiLabs\Projet_FeS\sources\test\MYHT_emulator_player.jar
    [delete] Deleting directory D:\01XiLabs\Projet_FeS\sources\test\preverified
    [mkdir] Created dir: D:\01XiLabs\Projet_FeS\sources\test\preverified
    [wtkbuild] **************************************************************
    [wtkbuild] * Antenna 0.9.14 initialized for project "test1" *
    [wtkbuild] * Using Sun Wireless Toolkit 2.5 (CLDC-1.1; MIDP-2.0) *
    [wtkbuild] **************************************************************
    [wtkbuild] Compiling 30 source files to D:\01XiLabs\Projet_FeS\sources\test\ed317818.tmp\tmpclasses
    [wtkbuild] WARNING
    [wtkbuild] The -source switch defaults to 1.5 in JDK 1.5 and 1.6.
    [wtkbuild] If you specify -target 1.1 you now must also specify -source 1.2.
    [wtkbuild] Ant will implicitly add -source 1.2 for you. Please change your build file.
    [wtkbuild] Preverifying D:\01XiLabs\Projet_FeS\sources\test\ed317818.tmp\tmpclasses
    [wtkjad] Creating JAD file D:\01XiLabs\Projet_FeS\sources\test\MYHT_emulator_player.jad
    [wtkpackage] Building jar: D:\01XiLabs\Projet_FeS\sources\test\MYHT_emulator_player.jar
    [wtkpackage] Obfuscating D:\01XiLabs\Projet_FeS\sources\test\MYHT_emulator_player.jar with ProGuard
    [wtkpackage] ProGuard, version 4.2
    [wtkpackage] Reading program jar [D:\01XiLabs\Projet_FeS\sources\test\MYHT_emulator_player.jar]
    [wtkpackage] Reading library jar [C:\WTK25\lib\midpapi20.jar]
    [wtkpackage] Reading library jar [C:\WTK25\lib\cldcapi11.jar]
    [wtkpackage] Reading library jar [C:\WTK25\lib\jsr082.jar]
    [wtkpackage] Preparing output jar [D:\01XiLabs\Projet_FeS\sources\test\df27d87c.tmp\obfuscated.jar]
    [wtkpackage] Copying resources from program jar [D:\01XiLabs\Projet_FeS\sources\test\MYHT_emulator_player.jar]
    [wtkpackage] Preverifying D:\01XiLabs\Projet_FeS\sources\test\MYHT_emulator_player.jar
    [wtkpackage] JAR file creation failed with error -1
    [wtkpackage] The preverified classes if any are in tmp25304. See jar log of errors in D:\01XiLabs\Projet_FeS\sources\test\df27d87c.tmp\jarlog.txt

    BUILD FAILED
    D:\01XiLabs\Projet_FeS\sources\test\build.xml:37: The following error occurred while executing this line:
    D:\01XiLabs\Projet_FeS\sources\test\build.xml:74: Preverification failed (result=1)

    Total time: 3 seconds

  4. #4
    Super Contributor
    Join Date
    Jun 2003
    Location
    Cheshire, UK
    Posts
    7,395

    Re: [HELP]eclipse build failed, preverification failed

    Hmmm... I think that something is holding the JAR open, so you can't write to it. I've seen this before.

    You could try preverifying like this...

    Code:
    <exec executable="${wtk.home}/bin/preverify.exe" newenvironment="true">
        <env key="PATH" path="${java.home}\bin"/>
        <arg line="-target CLDC1.1 -classpath ${wtk.midpapi} -d . ${app.name}.jar"/>
    </exec>
    Alternatively: I'm guessing you're writing preverified classes to the same JAR? Specify a different output filename.

    Cheers,
    Graham.

  5. #5
    Registered User
    Join Date
    Dec 2008
    Posts
    3

    Re: [HELP]eclipse build failed, preverification failed

    Thank you very very much! Graham! It works! My build is successful, thanks to you!
    You're so nice, so wonderful... love you,love this forum, love java!

Similar Threads

  1. Build failed while compiling c++
    By amalshah73 in forum Carbide.c++ IDE and plug-ins (Closed)
    Replies: 19
    Last Post: 2008-06-27, 14:23
  2. ARMI Build for fep fails
    By Blkangel in forum Symbian
    Replies: 0
    Last Post: 2004-01-27, 09:50
  3. armi build not working
    By lemody in forum Symbian
    Replies: 0
    Last Post: 2003-06-14, 15:04
  4. build of examples fails
    By unikande in forum Symbian Tools & SDKs
    Replies: 1
    Last Post: 2002-11-07, 11:48
  5. Replies: 1
    Last Post: 2002-10-10, 03:19

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×