1
votes

Im trying to automate our build process using bb ant tools and im running into a few errors

There are 3 different errors where 2 of them are related

[javac] D:\dev\java\workspaces\bb workspace\blackberry\Adaffix\src\com\adaffix\blackberry\AdaffixApplication.java:55: cannot find symbol [javac] symbol: class PhoneListener [javac] public class AdaffixApplication extends UiApplication implements PhoneListener, GlobalEventListener {

[javac] D:\dev\java\workspaces\bb workspace\blackberry\Adaffix\src\com\adaffix\blackberry\AdaffixApplication.java:29: package net.rim.blackberry.api.invoke does not exist [javac] import net.rim.blackberry.api.invoke.Invoke;

[javac] D:\dev\java\workspaces\bb workspace\blackberry\Adaffix\src\com\adaffix\blackberry\main\block\AddBlock.java:167: warning: unmappable character for encoding UTF-8 [javac] //tilf?j til db

and here is my build.xml

<?xml version="1.0" encoding="ISO-8859-1"?> 
<project name="appname" default="build" basedir=".">

    <!-- BLACKBERRY ANT TOOLS --> 
    <property name="bb-ant-tools.home" location="D:/dev/bb-ant-tools-1.2.13-bin" /> 
    <taskdef resource="bb-ant-defs.xml" classpath="${bb-ant-tools.home}/bb-ant-tools.jar" />    
    <property name="jdehome" value="D:/dev/eclipse/blackberry/plugins/net.rim.ejde.componentpack6.0.0_6.0.0.43/components" />
    <property name="jdkhome" value="C:/Program Files (x86)/Java/jdk1.6.0_34" />

    <!-- CONFIG STUFF  -->
    <property name="cod.name" value="appname" />
    <property name="app.name" value="appname" />
    <property name="app.version" value="2.7.5" /> 
    <property name="app.description" value="" /> 
    <property name="app.vendor" value="appname GmbH" /> 

    <!-- FOLDERS --> 
    <property name="build.dir" location="D:/dev/java/workspaces/bb workspace/blackberry/build" /> 
    <property name="bbminterface.dir" location="D:/dev/java/workspaces/bb workspace/blackberry/BBMInterface" /> 
    <property name="bbmimpl.dir" location="D:/dev/java/workspaces/bb workspace/blackberry/BBMImplementation" /> 
    <property name="main.dir" location="D:/dev/java/workspaces/bb workspace/blackberry/appname" /> 

    <target name="build" description="Builds Project">

        <!--<mkdir dir="${build.dir}" /> -->
        <javac target="1.4" source="1.4" destdir="${build.dir}" encoding="utf-8"> 
            <src path="${bbminterface.dir}/src"/> 
            <src path="${bbmimpl.dir}/src"/> 
            <src path="${main.dir}/src"/> 
            </javac>     


        <rapc output="BBMInterface" destdir="${build.dir}" jdehome="${jdehome}" jdkhome="${jdkhome}"  verbose="false" quiet="true" nowarn="true"> 
            <src> 
                <fileset dir="${bbminterface.dir}/src"/> 
            </src> 
            <jdp type="library" title="appname BBM Interface" vendor="${app.vendor}" version="1.0.0"> 
                <entry title="appname BBM Interface" description=""/>     
            </jdp> 
        </rapc> 
        <rapc output="BBMImplementation" destdir="${build.dir}" jdehome="${jdehome}" jdkhome="${jdkhome}" verbose="false" quiet="true" nowarn="true"> 
            <src> 
                <fileset dir="${bbmimpl.dir}/src"/> 
            </src> 
            <import location="${bbmimpl.dir}/external jars/bbm sdk/net_rim_bb_qm_platform.jar" /> 
            <import location="${build.dir}/BBMInterface.jar" /> 
            <jdp type="library" title="appname BBM Implementation" vendor="${app.vendor}" version="1.0.0" runonstartup="true" startuptier="6"> 
                <entry title="appname BBM Implementation" description="" runonstartup="true" startuptier="6"/>  
            </jdp> 
        </rapc> 

            <javac srcdir="${main.dir}" encoding="UTF-8" />
        <rapc output="${cod.name}" destdir="${build.dir}" jdehome="${jdehome}" jdkhome="${jdkhome}" verbose="false"> 

            <src> 
                <fileset dir="${main.dir}/src" /> 
            </src> 
            <src> 
                <fileset dir="${main.dir}/res" /> 
            </src> 
            <src>  
                <fileset file="${main.dir}/external jars/bb payment sdk/paymentapi.jar" /> 
                <fileset file="${main.dir}/external jars/bb advertising sdk/net_rim_bbapi_adv_app.jar" /> 
            </src> 
            <import location="${main.dir}/external jars/bb payment sdk/paymentapi.jar" /> 
            <import location="${main.dir}/external jars/bb advertising sdk/net_rim_bbapi_adv_app.jar" /> 
            <import location="${build.dir}/BBMInterface.jar"/> 

            <jdp type="cldc" title="${app.name}" vendor="${app.vendor}" icon="${main.dir}/res/image/icon.png" version="${app.version}" description="${app.description}" startuptier="7" ribbonposition="0"> 
                <entry title="${app.name}" icon="${main.dir}/res/image/icon.png" description="${app.description}" runonstartup="true" arguments="boot" systemmodule="true" startuptier="7" ribbonposition="0" /> 
                <!--<entry title="${app.name}" icon="../res/icon.png" description="@{description}" arguments="daemon" runonstartup="true" systemmodule="true" startuptier="7" ribbonposition="0" /> -->
            </jdp> 
        </rapc>
                <sigtool codfile="${build.dir}/BBMInterface.cod" password="password"/> 
                <sigtool codfile="${build.dir}/BBMImplementation.cod" password="password"/> 
                <sigtool codfile="${build.dir}/${cod.name}.cod" password="password" /> 
        </target> 
        <target name="sign" description="Sign the cod files"> 
        </target> 
    <!--<target name="clean"> 
        <delete dir="${dest.dir}" /> 
    </target> -->

</project> 

can anyone point me in the right direction? im kind of lost here i thought that all the RIM api's would get included by bb ant tools automatically

3

3 Answers

1
votes

Are you building on Linux or Windows? Rapc compiles java source to .class files with the Java SDK "javac" before compiling the class files into .cod files. Unfortunately, rapc does not provide any way to pass the "-encoding" option to javac, so you are stuck with the platform default encoding. This is cp-1252 on Windows, MacRoman on OSX, and UTF-8 on Linux. Since it is trying to interpret your source as UTF-8, I'll guess you're using linux.

There are three options for fixing this:

  1. You can go back to explicitly compiling the java source with the javac ant task. Your previous attempt wasn't working because you were still passing source code to rapc. Rapc can also start with class files, so you would do the javac step yourself, then pass the output directory to rapc for processing.

  2. If you don't want to sort out the javac command yourself, you can also override the default system encoding, with a patch to bb-ant-tools.

  3. If you only ever build your BlackBerry application on Linux, you can just switch your source file encoding to UTF-8 and be done with this. This won't work well if any developers are using Windows though. Windows is a common choice as it is the only place the simulators work. By switching to UTF-8 encoding, the Windows developers will face the same problem you are facing now - rapc will be compiling with the system default of cp-1252, but the source files will be in UTF-8.

0
votes

The problem isn't in bb-ant-tools.

Why do you need javac part if your rapc could build project from sources? You even don't use result of javac after. My recommendation to remove it and it will fix your build.

0
votes

happened to me. was because i hadn't copied selenium-server-standalone-3.4.0.jar to my C:\jars dir (ws.jars)