Welcome!

Welcome to the Official BlackBerry Support Community Forums. This is your resource to discuss support topics with your peers, and learn from each other. New to the forum? Please visit the ‘Getting Started’ link below.
inside custom component

Java Development

Reply
Developer
tibi95
Posts: 41
Registered: ‎09-27-2010

Other jar added in BB project - using BB ant tools

Hello,

 

I've created a small JAR file with some classes inside, to be shared between BlackBerry and Android platforms (let's say "common.jar").

I've preverified this JAR for BlackBerry and I've added in Eclipse project, and the application is working on Emulator.

 

The building for device (using a build.xml with blackberry ant tasks) is working, but after installation on the device, when I want to start the application I receive an error:

"Error starting app_name: Module 'common' not found."

 

So, I have some java files (for BlackBerry platform) and this JAR (for common code).

 

Can you help me with this BB ant tools? For sure the problem is with these tasks parameters (I've read the documentation), but I cannot handle :smileysad:

 

Thank you very much,

Tibi.

 

Please use plain text.
Developer
tibi95
Posts: 41
Registered: ‎09-27-2010

Re: Other jar added in BB project - using BB ant tools

[ Edited ]

Hello,

 

Meantime I found a solution: the external preverified JAR file must be included together with the rest of the project files.

If you are using the "import" attribute of rapc, it is not enough: the application just compiles ok, but that external JAR (or its content) is not added in final COD files.

 

I fixed this stuff in the following way:

 

<rapc destdir="${dest.dir}" output="${app.name}" jdehome="${jde.home}" jdkhome="${jdk.home}">
  <src>
    <fileset dir="${app.source}"/>
    <fileset file="${external.lib}"/>
  </src>

  <jdp ....

 

Maybe you know a better solution...

 

Please use plain text.
Developer
dnepr
Posts: 723
Registered: ‎03-12-2009

Re: Other jar added in BB project - using BB ant tools

The other solution is to import them and load COD's for those libaries with your main app.

 

If those JAR's are simply interface stubs, you won't get anything useful by fusing them into the distribution.

Please use plain text.
New Developer
CobiRic
Posts: 21
Registered: ‎03-31-2011
My Carrier: none

Re: Other jar added in BB project - using BB ant tools

To clarify what dnepr said, since it took me some research to figure it out.

If you compile a library file in eclipse, as part of compiling the main application, then you will find a library.jar file in the deliverables folder of the library project.

That jar file only contains interface stubs, with no actual method implementations.

If you want your library.jar file to contain valid code, it must not be compiled in this way.
www.cobiinteractive.com
www.madmob.co.za
Please use plain text.