×

Discussion Board

Results 1 to 13 of 13
  1. #1
    Registered User
    Join Date
    Apr 2009
    Posts
    12

    Preverification failed (result=1) in build.xml

    Hi there,
    I have a problem with my ant.
    Whenever I try to build project (compile) I get following error:
    C:\Users\Administrateur\workspace\WritingImageToNDEFTag\build.xml:44: Preverification failed (result=1)

    I use S40_Nokia_6212_NFC_SDK
    Please suggest me solution for this problem...

    Thanks.

    builde.xml file :

    <project name="WritingImageToNDEFTag" default="compile-real">
    <taskdef resource="antenna.properties" classpath="D:\antenna-bin-1.0.2.jar"/>

    <property name="wtk.home" value="C:\Nokia\Devices\S40_Nokia_6212_NFC_SDK"/>
    <property name="wtk.proguard.home" value="C:\proguard4.3"/>

    <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="app.name" value="WritingImageToNDEFTag"/>
    <property name="app.midlet" value="org.moi.WritingImageToNDEFTag"/>

    <!--<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}/cldc11.jar;${wtk.libs}/midp20.jar;${wtk.libs}/jsr082.jar;${wtk.libs}/jsr172.jar;${wtk.libs}/jsr75.jar;${wtk.libs}/jsr257.jar" />

    <target name="preproc-test">
    <!--<wtkpreprocess srcdir="src" destdir="src" symbols="COMPILE_TEST" verbose="true"/>
    --></target>

    <target name="preproc-real">
    <!--<wtkpreprocess srcdir="src" destdir="src" symbols="COMPILE_REAL" verbose="true"/>
    --></target>


    <target name="compile-test">
    <antcall target="preproc-test"/>
    <antcall target="compile"/>
    </target>

    <target name="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}.jad"/>
    <delete file="${app.name}.jar"/>

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

    <wtkjad jadfile="${app.name}.jad"
    jarfile="${app.name}.jar"
    name="${app.name}"
    vendor="coucou"
    version="1.0.0" >
    <midlet name="${app.name}" class="${app.midlet}" />

    </wtkjad>
    <wtkpackage jarfile="${app.name}.jar" jadfile="${app.name}.jad" obfuscate="false" preverify="true">
    <fileset dir="preverified"/>
    <fileset dir="res" includes="*.*"/>
    </wtkpackage>
    </target>

    <target name="obfuscate">
    <wtkobfuscate jarfile="${app.name}.jar" jadfile="${app.name}.jad" obfuscator="proguard">
    <preserve class="org.moi.WritingImageToNDEFTag"/>
    <argument value="-overloadaggressively"/>
    <argument value="-allowaccessmodification"/>
    <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">

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


    and after compil :


    Buildfile: C:\Users\Administrateur\workspace\WritingImageToNDEFTag\build.xml
    compile:
    [echo] C:\Nokia\Devices\S40_Nokia_6212_NFC_SDK\lib/cldc11.jar;C:\Nokia\Devices\S40_Nokia_6212_NFC_SDK\lib/midp20.jar;C:\Nokia\Devices\S40_Nokia_6212_NFC_SDK\lib/jsr082.jar;C:\Nokia\Devices\S40_Nokia_6212_NFC_SDK\lib/jsr172.jar;C:\Nokia\Devices\S40_Nokia_6212_NFC_SDK\lib/jsr75.jar;C:\Nokia\Devices\S40_Nokia_6212_NFC_SDK\lib/jsr257.jar
    [delete] Deleting directory C:\Users\Administrateur\workspace\WritingImageToNDEFTag\preverified
    [mkdir] Created dir: C:\Users\Administrateur\workspace\WritingImageToNDEFTag\preverified
    [wtkbuild] **************************************************************
    [wtkbuild] * Antenna 1.0.1 initialized for project "WritingImageToNDEFTag" *
    [wtkbuild] * Using Unknown Toolkit (CLDC-1.0; MIDP-1.0) *
    [wtkbuild] **************************************************************
    [wtkbuild] Compiling 1 source file to C:\Users\Administrateur\workspace\WritingImageToNDEFTag\23fe55a0.tmp\tmpclasses
    [wtkbuild] Preverifying C:\Users\Administrateur\workspace\WritingImageToNDEFTag\23fe55a0.tmp\tmpclasses
    [wtkbuild] ERROR: floating-point arguments should not appear
    [wtkbuild] Error preverifying class java.lang.String
    [wtkbuild] Error preferifying, log file not found: C:\Users\Administrateur\workspace\WritingImageToNDEFTag\preverified\jarlog.txt


    BUILD FAILED
    C:\Users\Administrateur\workspace\WritingImageToNDEFTag\build.xml:44: Preverification failed (result=1)

    Total time: 920 milliseconds

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

    Re: Preverification failed (result=1) in build.xml

    I notice you're getting an error, because you're writing for CLDC-1.1, and Antenna thinks you're targetting CLDC-1.0. Try setting wtk.home to point to the Sun Wireless Toolkit.

  3. #3
    Registered User
    Join Date
    Apr 2009
    Posts
    12

    Re: Preverification failed (result=1) in build.xml

    Thank's very match grahamhughes
    you have give me the solution. I can generate .jad & .jar and compiling
    but if I leave the value of preverify as false i get a build succefful and when i change it as true, i receive a new error.
    and obfuscate does not work ([wtkobfuscate] Warning: org.tlogic.WritingImageToNDEFTag: can't find superclass or interface javax.microedition.contactless.TargetListener)

    Because I must use the jsr257.jar to emulate writing image to NDEF tag (I use the sdk nokia 6212)

    cordialy

    <wtkpackage jarfile="${app.name}.jar" jadfile="${app.name}.jad" obfuscate="false" preverify="true">
    <fileset dir="preverified"/>
    <fileset dir="res" includes="*.*"/>
    </wtkpackage>


    Buildfile: N:\workspace\WritingImageToNDEFTag\build.xml
    compile:
    [echo] C:\WTK2.5.2_01\lib/cldcapi11.jar;C:\WTK2.5.2_01\lib/midpapi20.jar;C:\WTK2.5.2_01\lib/jsr082.jar;C:\Nokia\Devices\S40_Nokia_6212_NFC_SDK\lib/jsr172.jar;C:\WTK2.5.2_01\lib/jsr75.jar;C:\Nokia\Devices\S40_Nokia_6212_NFC_SDK\lib/jsr257.jar
    [delete] Deleting: N:\workspace\WritingImageToNDEFTag\WritingImageToNDEFTag.jad
    [delete] Deleting: N:\workspace\WritingImageToNDEFTag\WritingImageToNDEFTag.jar
    [delete] Deleting directory N:\workspace\WritingImageToNDEFTag\preverified
    [mkdir] Created dir: N:\workspace\WritingImageToNDEFTag\preverified
    [wtkbuild] **************************************************************
    [wtkbuild] * Antenna 1.0.1 initialized for project "WritingImageToNDEFTag" *
    [wtkbuild] * Using Sun Wireless Toolkit 2.5 (CLDC-1.1; MIDP-2.0) *
    [wtkbuild] **************************************************************
    [wtkbuild] Compiling 1 source file to N:\workspace\WritingImageToNDEFTag\c75e3bd7.tmp\tmpclasses
    [wtkbuild] Preverifying N:\workspace\WritingImageToNDEFTag\c75e3bd7.tmp\tmpclasses
    [wtkjad] Creating JAD file N:\workspace\WritingImageToNDEFTag\WritingImageToNDEFTag.jad
    [wtkpackage] Building jar: N:\workspace\WritingImageToNDEFTag\WritingImageToNDEFTag.jar
    [wtkpackage] Preverifying N:\workspace\WritingImageToNDEFTag\WritingImageToNDEFTag.jar
    [wtkpackage] Error preverifying class org.tlogic.WritingImageToNDEFTag
    [wtkpackage] java/lang/NoClassDefFoundError: javax/microedition/contactless/TargetListener

    [wtkpackage] Error preferifying, log file not found: N:\workspace\WritingImageToNDEFTag\61d1a895.tmp\jarlog.txt

    BUILD FAILED
    N:\workspace\WritingImageToNDEFTag\build.xml:58: Preverification failed (result=1)

    Total time: 719 millisecond

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

    Re: Preverification failed (result=1) in build.xml

    You need to specify a classpath in the wktbuild, so the obfuscator and preverifier can find all the classes.

    Cheers,
    Graham.

  5. #5
    Registered User
    Join Date
    Apr 2009
    Posts
    12

    Re: Preverification failed (result=1) in build.xml

    I have specified the classpath in th wtkbuild , but i get the same error
    please if you have any other idea
    I thank you for your's responses
    cordially
    Caradine

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

    Re: Preverification failed (result=1) in build.xml

    I said wtkbuild, but I meant wtkpackage. :-)

  7. #7
    Registered User
    Join Date
    Apr 2009
    Posts
    12

    Re: Preverification failed (result=1) in build.xml

    Mr Graham

    Thanks for the ideas and your

    the build, priverification and the obfuscation are succefful.
    my last question : the obsfiscate i get this result :
    I don't know what signifify and if the result is true.
    I am very happy to solve this problem with you. you are generous.

    Cordialy caradine

    wtkobfuscate] Initializing...
    [wtkobfuscate] Note: there were 1032 duplicate class definitions.
    [wtkobfuscate] Note: the configuration refers to the unknown class 'org.tlogic.WritingImageToNDEFTag'
    [wtkobfuscate] Note: there were 1 references to unknown classes.
    [wtkobfuscate] You should check your configuration for typos.
    [wtkobfuscate] Ignoring unused library classes...
    [wtkobfuscate] Original number of library classes: 1349
    [wtkobfuscate] Final number of library classes: 44
    [wtkobfuscate] Shrinking...
    [wtkobfuscate] Removing unused program classes and class elements...
    [wtkobfuscate] Original number of program classes: 1
    [wtkobfuscate] Final number of program classes: 1
    [wtkobfuscate] Inlining subroutines...
    [wtkobfuscate] Optimizing...
    [wtkobfuscate] Number of merged classes: 0
    [wtkobfuscate] Number of finalized classes: 0
    [wtkobfuscate] Number of privatized fields: 0
    [wtkobfuscate] Number of privatized methods: 0
    [wtkobfuscate] Number of staticized methods: 0
    [wtkobfuscate] Number of finalized methods: 0
    [wtkobfuscate] Number of removed write-only fields: 0
    [wtkobfuscate] Number of inlined constant fields: 0
    [wtkobfuscate] Number of inlined constant methods: 0
    [wtkobfuscate] Number of simplified method declarations: 0
    [wtkobfuscate] Number of removed parameters: 0
    [wtkobfuscate] Number of removed local variables: 0
    [wtkobfuscate] Number of inlined method calls: 0
    [wtkobfuscate] Number of simplified tail recursion calls: 0
    [wtkobfuscate] Number of removed exception blocks: 1
    [wtkobfuscate] Number of merged code blocks: 0
    [wtkobfuscate] Number of simplified push instructions: 0
    [wtkobfuscate] Number of simplified branches: 0
    [wtkobfuscate] Number of removed instructions: 0
    [wtkobfuscate] Number of peephole optimizations: 9
    [wtkobfuscate] Shrinking...
    [wtkobfuscate] Removing unused program classes and class elements...
    [wtkobfuscate] Original number of program classes: 1
    [wtkobfuscate] Final number of program classes: 1
    [wtkobfuscate] Obfuscating...
    [wtkobfuscate] Preverifying...
    [wtkobfuscate] Writing output...
    [wtkobfuscate] Preparing output jar [C:\Users\Administrateur\workspace\WritingImageTag\c1e271a6.tmp\output.jar]
    [wtkobfuscate] Copying resources from program jar [C:\Users\Administrateur\workspace\WritingImageTag\WritingImageTag.jar]
    [wtkobfuscate] Updating JAD file C:\Users\Administrateur\workspace\WritingImageTag\WritingImageTag.jad
    BUILD SUCCESSFUL
    Total time: 4 seconds

  8. #8
    Registered User
    Join Date
    Apr 2009
    Posts
    12

    Re: Preverification failed (result=1) in build.xml

    suite:
    I would like launch the nokia emulator.exe 6212 witch i use to emulate read/write tag NFC and RFID
    but there is one error.
    Can you help me it is my last step to run my applications, thank's very mutch
    here is my build.xml

    <property name="sdk.nokia.home" value="C:\Nokia\Devices\S40_Nokia_6212_NFC_SDK"/>.................
    ................................................................................................
    <target name="run">

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

    </target>

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

    Re: Preverification failed (result=1) in build.xml

    The warning you get from the obfuscator is probably because you have duplicate JARs in your build-path. It won't do any harm, but you can probably fix it easily enough.

    What is the error you get when launching the emulator? Possibly the command line is incorrect. It looks right for the WTK emulator, but Nokia's might have a different syntax. Check the Nokia SDK documentation.

  10. #10
    Registered User
    Join Date
    Apr 2009
    Posts
    12

    Re: Preverification failed (result=1) in build.xml

    I think there is not error, but the emulator does not launch.
    I have try with sun sdk emulator and Prototype_3_0_S40_128x128_MIDP_Emulator, I can launch it.
    with S40_Nokia_6212_NFC_SDK i get this result when i launch run command :
    Buildfile: N:\workspace\WritingImageTag\build.xml
    run:
    [exec] Usage: emulator [-options] [Application]
    [exec] where options include:
    [exec] -help Display this text
    [exec] -version Display version information about the emulator
    [exec] -classpath The class path for the VM
    [exec] -Xverbose[:allocation | gc | gcverbose | class | classverbose | verifier
    [exec] | stackmaps | bytecodes | methods | methodsverbose | frames
    [exec] | stackchunks | exceptions | events | threading | monitors
    [exec] | networking | all
    [exec] Enable verbose output
    [exec] -Xquery Print SDK option information and immediately exit
    [exec] -Xnew Forces a new emulator instance to be created, even if
    [exec] an existing emulator instance may be available for reuse.
    [exec] -Xuse:<phone number>
    [exec] Specifies a particular emulator instance to be reused, if that emulator
    [exec] instance exists and emulator instance reuse has been enabled.
    [exec] -Xkdpv:<level>
    [exec] Specifies the message tracing level (0 to 9) for the KVM debug proxy.
    [exec] -Xdebug Use a remote debugger
    [exec] -Xrunjdwp:[address=<address>,transport=dt_socket,server=<y>,suspend=<y>]
    [exec] Debugging options
    [exec] -Xdevice:<device name>
    [exec] Name of the device to be emulated
    [exec] -Xdescriptor:<jad file name>
    [exec] The JAD file to be executed
    [exec] -Xjam[:install=<jad or jar file url>]
    [exec] Java Application Manager and support
    [exec] for Over The Air provisioning (OTA)
    [exec] -Xheapsize:<size>
    [exec] (e.g. 65536 or 128k or 1M)
    [exec] Specifies the VM heapsize
    [exec] -Xhttp_proxy:<address>[:<port>]
    [exec] Defines the address and port number of the http proxy.
    [exec] -Xinbox:<file path>
    [exec] Specifies the path for the message inbox directory.
    [exec] -Xlanguage:<language name>
    [exec] Specifies the language for the SDK to operate in.
    [exec] -Xoutbox:<file path>
    [exec] Specifies the path for the message outbox directory.
    [exec] -Xontop If specified the SDK GUI window will always be on top of all
    [exec] other windows.
    [exec] -Xsecurity_domain:<domain name>
    [exec] Specifies a security domain for the MIDlet.
    [exec] Domain name can take the one of following values: Trusted, Untrusted, Maximum, Minimum.
    [exec] Result: 1
    BUILD SUCCESSFUL
    Total time: 235 milliseconds

  11. #11
    Registered User
    Join Date
    Apr 2009
    Posts
    12

    Re: Preverification failed (result=1) in build.xml

    I try with cmd console, I can launch emulator well with this command :
    C:\Nokia\Devices\S40_Nokia_6212_NFC_SDK\bin>emulator.exe -Xdescriptor:N:\workspace\WritingImageTag\WritingImageTag.jad -classpath N:\workspace\WritingImageTag\WritingImageTag.jar
    and i can debug

  12. #12
    Registered User
    Join Date
    Apr 2009
    Posts
    12

    Re: Preverification failed (result=1) in build.xml

    Quote Originally Posted by caradine View Post
    I try with cmd console, I can launch emulator well with this command :
    C:\Nokia\Devices\S40_Nokia_6212_NFC_SDK\bin>emulator.exe -Xdescriptor:N:\workspace\WritingImageTag\WritingImageTag.jad -classpath N:\workspace\WritingImageTag\WritingImageTag.jar
    and i can debug
    Now i use 6131 emulator, and i can launch it well

    thank you

  13. #13
    Registered User
    Join Date
    Nov 2005
    Posts
    158

    Re: Preverification failed (result=1) in build.xml

    This is because wtkpackage is using preverify1.0.exe instead of 1.1 ones.

    Set the ant property

    wtk.cldc.version=1.1

    The preverify should preverify1.1.exe

    Regards,
    Raja Nagendra Kumar
    www.tejasoft.com

Similar Threads

  1. Preverification failed - Help
    By timharvey in forum Mobile Java Tools & SDKs
    Replies: 2
    Last Post: 2010-10-10, 01:31
  2. S60 5th ed emulator startup failed
    By hony in forum Symbian Tools & SDKs
    Replies: 8
    Last Post: 2009-08-11, 21:12
  3. [HELP]eclipse build failed, preverification failed
    By yanchenfr in forum Mobile Java General
    Replies: 4
    Last Post: 2009-02-19, 21:41
  4. S60 2nd to 3rd/ PlatformSecurity / Capabilities
    By jarkoos in forum Symbian Signed Support, Application Packaging and Distribution and Security
    Replies: 4
    Last Post: 2007-04-14, 14:08
  5. Eclipse build problem
    By walter73 in forum Mobile Java General
    Replies: 7
    Last Post: 2006-07-26, 12: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
  •  
×