BlackBerry Forums Support Community
              

Closed Thread
 
Thread Tools
Old 11-09-2009, 06:37 PM   #1
eugp13
New Member
 
Join Date: Nov 2009
Model: 8330
PIN: N/A
Carrier: Verizon
Posts: 3
Default 2 apps using the same library cause a conflict

Please Login to Remove!

Hi, I develop a library that gets precompiled and distributed as a jar file to different apps which included it in their cod.
When I have a phone with 2 separate apps using this library installed, and when I try to launch one of them, it gives me an error, telling me that a class is redefined.

I initially compile the library as a midlet using the rapc ant task in eclipse.

The apps, when compiled, include the midlet jar file within the src element nested under rapc.

So my questions are as such.

1) Am I doing something wrong that's causing this library to interfere across apps?
2) If that's the case, is there a way to check if the first library is installed, and install it only if it isn't?
3) If not, how do I compile this library into an application without revealing its source.

Any help would be greatly appreciated.
-Eugene
Offline  
Old 11-10-2009, 04:31 AM   #2
Ivanov
Talking BlackBerry Encyclopedia
 
Join Date: Apr 2008
Location: Germany, BW
Model: -
PIN: N/A
Carrier: -
Posts: 310
Default

Is your library compiled as a separate cod file or do you include the jar file in your project and let it compile into your application?

The error you get noramlly means that on your device you have two cod files which define same classes in same package names

You have to put your lib in a separate cod file.
__________________
Blessed is the end user who expects nothing, for he/she will not be disappointed. (Franklin's Rule)
Offline  
Old 11-10-2009, 01:25 PM   #3
eugp13
New Member
 
Join Date: Nov 2009
Model: 8330
PIN: N/A
Carrier: Verizon
Posts: 3
Default

Thank you for your reply.
Is there a way by which the primary application can check for the presence of the cod file containing the library, and install it if and only if it's not there?
Offline  
Old 11-10-2009, 05:03 PM   #4
Ivanov
Talking BlackBerry Encyclopedia
 
Join Date: Apr 2008
Location: Germany, BW
Model: -
PIN: N/A
Carrier: -
Posts: 310
Default

create an instance of the class and catch a ClassNotFoundException if the lib cod doesn't exist
__________________
Blessed is the end user who expects nothing, for he/she will not be disappointed. (Franklin's Rule)
Offline  
Closed Thread



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


Vintage Apple 1 16 Pin IC Socket - NOS  picture

Vintage Apple 1 16 Pin IC Socket - NOS

$3.99



Vintage Apple Computer 4” Paper Cube Notepad Macintosh 80s 90s Office White picture

Vintage Apple Computer 4” Paper Cube Notepad Macintosh 80s 90s Office White

$39.95



Vintage Apple Day Planner Zipper Mead Office Products New W/ Tags  picture

Vintage Apple Day Planner Zipper Mead Office Products New W/ Tags

$59.99



Vintage Post-it Note Pad Apple Magnetic Holder Pince A Notes Unused 1988 NOS picture

Vintage Post-it Note Pad Apple Magnetic Holder Pince A Notes Unused 1988 NOS

$11.04



VINTAGE 1994 Apple Black Toner Laser Writer Cartridge M 2473 G/A NEW SEALED picture

VINTAGE 1994 Apple Black Toner Laser Writer Cartridge M 2473 G/A NEW SEALED

$25.95



Lot of 6 Vintage Apple Drawstring Bags For iPhone, Mac, Apple Watch, iPod picture

Lot of 6 Vintage Apple Drawstring Bags For iPhone, Mac, Apple Watch, iPod

$45.00







Copyright 2004-2016 BlackBerryForums.com.
The names RIM and BlackBerry are registered Trademarks of BlackBerry Inc.