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: 16
Registered: ‎10-27-2008
My Device: Bold

Error while building in Eclipse

I'm using Eclipse 3.4.1 and the new BlackBerry plugin and building for 4.6.

 

When I attempt to build a project I get the follow error for a class that extends ActiveRichTextField

 

"The project was not built since its build path is incomplete. Cannot find the class file for net.rim.tid.text.AttributedTextIterator. Fix the build path then try building this project"

 

"The type net.rim.tid.text.AttributedTextIterator cannot be resolved. It is indirectly referenced from required .class files"

 

The suggested fix is to "fix the build path" but I've already got NET_RIM_BLACKBERRY in the build path, and I don't know what else I would need.

 

Any ideas on what I can do to fix this?

 

Thanks,

Andrea

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

Re: Error while building in Eclipse

try switching the project compiler to 1.4
not sure if it is neccessary when you work with the plugin, but without it is.
----------------------------------------------------------
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: 16
Registered: ‎10-27-2008
My Device: Bold

Re: Error while building in Eclipse

I gave it a try, but switching the compiler version doesn't help.
BlackBerry Development Advisor
Posts: 15,752
Registered: ‎07-09-2008
My Device: BlackBerry PRIV
My Carrier: Bell

Re: Error while building in Eclipse

I created a basic class that also extended ActiveRichTextField and could not reproduce this error.  Can you post the source code for a class that triggers this error?
Mark Sohm
BlackBerry Development Advisor

Please refrain from posting new questions in solved threads.
Problem solved? Click the Accept As Solution button.
Found a bug? Report it using Issue Tracker
Developer
Posts: 292
Registered: ‎07-25-2008
My Device: Passport

Re: Error while building in Eclipse

I'm going to have to tack on a "me too" post to this thread.  In my case, it highlights a call to the following method:

AutoTextEditField.insert(string)

 

And has the following error:

The type net.rim.tid.text.AttributedString$AttribStoreFilter cannot be resolved. It is indirectly referenced from required .class files

 

Now here's the best part...  This *only* happens when I select the component pack for 4.6.0 or 4.7.0.  If I pick 4.5 or older, I get no errors, and everything works just fine.

 

(also, if I select "Project -> Build Active BlackBerry Configuration" from the menu, it builds without errors)

 

Developer
Posts: 292
Registered: ‎07-25-2008
My Device: Passport

Re: Error while building in Eclipse

Well, I've done some digging, and I think I know what the problem is (but not how to fix it).  Some of the RIM API classes in 4.6 (and up) contain inner classes that extend classes which are not in net_rim_api.jar.  In particular, the "net.rim.tld.text" package, for starters.  This means we need one of the following things done:

 

1) Get a version of net_rim_api.jar that isn't missing things

2) Get a second "make Eclipse shut up" jar that contains just enough of the missing classes

3) Figure out how to make Eclipse not complain about reference problems in libraries

 

BlackBerry Development Advisor
Posts: 15,752
Registered: ‎07-09-2008
My Device: BlackBerry PRIV
My Carrier: Bell

Re: Error while building in Eclipse

Are you using the second beta release of the plug-in (version 1.0.0.50)?  An issue similar to this issue did exist in the first beta version, but was fixed in the second beta update that was released in October.

Mark Sohm
BlackBerry Development Advisor

Please refrain from posting new questions in solved threads.
Problem solved? Click the Accept As Solution button.
Found a bug? Report it using Issue Tracker
Developer
Posts: 292
Registered: ‎07-25-2008
My Device: Passport

Re: Error while building in Eclipse

I'm using the second beta release (1.0.0.50).  (which for the component packs, I see versions 4.3.0.13, 4.5.0.14, 4.6.0.16, and 4.7.0.36)
BlackBerry Development Advisor
Posts: 15,752
Registered: ‎07-09-2008
My Device: BlackBerry PRIV
My Carrier: Bell

Re: Error while building in Eclipse

Thank you for the clarification.  This issue has been reported to our development team.
Mark Sohm
BlackBerry Development Advisor

Please refrain from posting new questions in solved threads.
Problem solved? Click the Accept As Solution button.
Found a bug? Report it using Issue Tracker
New Developer
Posts: 12
Registered: ‎11-12-2008
My Device: Not Specified

Re: Error while building in Eclipse

Here is the code for a test that shows this extremely annoying error.

 

import net.rim.device.api.ui.*;
import net.rim.device.api.util.*;
import net.rim.device.api.ui.component.*;
import net.rim.device.api.ui.container.*;
import net.rim.device.api.system.*;
import net.rim.blackberry.api.menuitem.*;

public class Test extends UiApplication
{
public Test()
{
MainScreen screen = new MainScreen();
pushScreen(screen);
String[] lines =
{
"Genre: Documentary",
"Wedensday, February 25th",
" \u2022 6pm (CAL) - Opening Night Film $film_title",
"Thursday, February 26th",
" \u2022 11am (C12) - $film_title",
" \u2022 11:15am (C12) - $film_title",
" \u2022 12pm (REP) - $film_title",
" \u2022 1pm (CAL) - $really really really long film title that will continue to a second line_title" };
StringBuffer buffer = new StringBuffer();
int[] off = new int[lines.length + 1];
byte[] attrs = new byte[lines.length];
Font[] fonts = new Font[2];
int[] foregroundColors = new int[2];
int[] backgroundColors = new int[2];
FontFamily fontfam[] = FontFamily.getFontFamilies();
fonts[0] = fontfam[0].getFont(FontFamily.SCALABLE_FONT, 16);
fonts[1] = fontfam[0].getFont(FontFamily.SCALABLE_FONT, 12);
foregroundColors[0] = 0;
foregroundColors[1] = 0;
backgroundColors[0] = 0xffffff;
backgroundColors[1] = 0xffffff;
off[0] = 0;
for (int i = 0; i < lines.length; i++)
{
buffer.append(lines[i]);
buffer.append("\n");
off[i + 1] = off[i] + lines[i].length() + 1;
attrs[i] = (byte) (lines[i].startsWith(" \u2022") ? 1 : 0);
}
screen.add(new ActiveRichTextField(buffer.toString(), off, attrs,
fonts, foregroundColors, backgroundColors,
RichTextField.TEXT_ALIGN_LEFT));
}

public static void main(String[] args)
{
new Test().enterEventDispatcher();
}
}

The error message is

 

The type net.rim.device.api.ui.component.ActiveRichTextField$RegionQueue cannot be resolved. It is indirectly referenced from required .class files.

 

I use JDE 4.1.0 (for backwards compatibility). Indeed, whoever put together the library file, neglected to add in certain inner classes.