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.

inside custom component

Java Development

Reply
Developer
Posts: 38
Registered: ‎02-04-2009
My Device: 9530
Accepted Solution

Linker multiply defined revisited

hey guys,

 

So I'm running into this classic problem:


Class 'util.ArrayList' multiply defined.
Linker error: 'VerifyError' for ProjectName
Error starting ProjectName: Class 'util.ArrayList' multiply defined.

 

So what happened is I'm using the 8800 simulator. I've been using it to run my program for 8 months. And all of a sudden when I try to run my program it will crash and I can't run it anymore. Now the same thing happened with me for the Bold emulator about 4 months ago. The curve 8300 still works but I'm running out of working simulators...What is causing this?

 

I've already scoured the RIM directory and deleted all of my project files. I've already run clean.bat. I've already selected Clean All and Build All in the IDE. I've deleted my local cod and setup files and rebuilt them. util.ArrayList is not multiply defined. It is some kind of corruption. Short of reinstalling the simlator (which I'm unsure if it will fix the problem), has anyone fixed this problem or have any advice?

Developer
Posts: 17,019
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport
My Carrier: O2 Germany

Re: Linker multiply defined revisited

ArrayList is your own class? Do you use it in a library? Is it persistable?
----------------------------------------------------------
feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.
@SimonHain on twitter
Developer
Posts: 38
Registered: ‎02-04-2009
My Device: 9530

Re: Linker multiply defined revisited

yes, its my own ArrayList class.

 

public class ArrayList implements Persistable

 

It is persistable, I don't have it in a Library. Does it need to be in a library? That kind of wouldn't make sense because I've been running this program for months without any problems of having it be in a library.

Highlighted
Developer
Posts: 17,019
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport
My Carrier: O2 Germany

Re: Linker multiply defined revisited

persistable classes have to be unique. if you use a class with the same name in another project you get the multiply defined error.
it is also possible to get this error if more then one version of a software is installed, but clean.but should take care of this.
another possible source are multiple entry points that use a persistable class.

try to give it a unique name (Project1ArrayList) or use a generic class like Vector for peristence.
----------------------------------------------------------
feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.
@SimonHain on twitter
Developer
Posts: 38
Registered: ‎02-04-2009
My Device: 9530

Re: Linker multiply defined revisited

Well, I don't have any other projects. This is my only one.

 

I do have IDE version 4.6 and 4.7 installed, but I can still run other 4.6 versions, so I don't think this could be it.

 

I feel like it could be a multiple entry point that occurs, so I'm going through all my classes removing any imports of java.util in hopes it is an ArrayList confliction, I'll let you know what happens

Developer
Posts: 38
Registered: ‎02-04-2009
My Device: 9530

Re: Linker multiply defined revisited

hmm,  unfortunately it didnt work Smiley Sad

 

I'm reluctant to change the name of every single reference to ArrayList because I have like 200+ references Smiley Indifferent

 

Do you think uninstalling and reinstalling that particular simulation will fix it?

Developer
Posts: 17,019
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport
My Carrier: O2 Germany

Re: Linker multiply defined revisited

no, a re-install won't fix it

don't you use a "real" IDE? like eclipse? refactoring in eclipse is only a few clicks, and all your 200 references are renamed.
----------------------------------------------------------
feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.
@SimonHain on twitter
Developer
Posts: 38
Registered: ‎02-04-2009
My Device: 9530

Re: Linker multiply defined revisited

hahaha, unfortunately no. I use the RIM approved JDE's for quick simulator switching. It sucks but it doesn't have any overhead problems with setting things up.

 

I just read your message and I already uninstalled and began reinstalling... oh well

 

If this fails I'll try that next...

Developer
Posts: 38
Registered: ‎02-04-2009
My Device: 9530

Re: Linker multiply defined revisited

to my unexpected surprise, it refreshed the program and it can run again Smiley Indifferent

 

i know its our job, but don't you just hate computers...

Developer
Posts: 38
Registered: ‎02-04-2009
My Device: 9530

Re: Linker multiply defined revisited

[ Edited ]

well to recap for anyone else who comes across this thread, in this particular case a reinstall of the simulator worked. Make sure you uninstall using Add/Remove Programs.

But its unlikely this will fix a whole lot of other situations. I think I've even tried this before in the past and it failed. Anyways, if you can't figure out this error its eventually worth a try.

 

 thanks simon for the help, I really appreciate it man. these problems can be impossible to fix by yourself Smiley Happy

Message Edited by azdragon2 on 07-14-2009 04:58 AM