0

When I try to launch my application in Blackberry device/simulator, I'm getting class not found exception. This happens for multiple classes like PermissionsManager, CoverageInfo etc.

What I want to know is what all reasons will end up on "Class not found exception" ? What's the best way to troubleshoot this problem ?

Lucifer
  • 29,392
  • 25
  • 90
  • 143
Kris
  • 189
  • 13

1 Answers1

1

You are launching application created with newer RIM API SDK on device with older device OS software.

ApplicationPermissionsManager class is available for device os 4.2.1 or above.

CoverageInfo class is available for device os 4.2.0 or above.

Seems that you are running your app on device with OS older than 4.2.0

And classes you used just are not implemented in your device software (device OS).

  • Thanks for your reply Rafael. I'm using OS version 6.0 (BlackBerry Torch). Till last Friday the app was working fine. After that I did some changes like including facebook API for sharing, Flurry SDK, Janrain integration etc. I'm not understanding why is this happening. :-( – Kris Aug 09 '11 at 11:58
  • Seems that the error was occured into attached libraries (Facebook API, etc). It is hard to say what exactly caused the problem, perhaps these libs are incorrectly attached/built. –  Aug 09 '11 at 12:01
  • Are you including the libraries as source code, or by including pre-compiled jar files? If jar files, have you properly pre-verified them for inclusion in your project? And are you linking in the pre-verified versions instead of the originals? – Scott W Aug 09 '11 at 12:26
  • Ok, I'll double check that. I have another doubt. Does the .classpath has anything to do with this ? As the exception occurs for multiple inbuilt classes, I fear there may be something gone wrong with the class-path. – Kris Aug 09 '11 at 12:48
  • Classpath is not related to this problem. Run preverify.exe against the jar-libraries you are using in your project. Preverify.exe is located in JDE/bin folder. –  Aug 09 '11 at 13:00
  • I'm using Eclipse and BlackBerry plugin 1.3.0 – Kris Aug 09 '11 at 13:19
  • I do not use Eclipse/JDE Plugin and cannot say exactly the location of this file in Eclipse/JDE plugin. Run file search on your computer and find the file: preverify.exe –  Aug 09 '11 at 13:23
  • ok, let me check. On googling, I found this link - http://stackoverflow.com/questions/6006493/class-not-found-exception-after-adding-a-new-image-to-the-resource-folder. Rafael, Do you know about this ? Actually my application is a lil big one and the total image size is around 14MB now. – Kris Aug 09 '11 at 13:44
  • I am aware that big cod-files cause problems, even on the most recent devices/os-es. Split your project to several cod files. Append image resources to another library project and make reference to this library project from your main application project. You will get several cod files with smaller size. And you will need to install them together to the device. –  Aug 09 '11 at 13:53
  • I think the big sized .cod files are causing the issues. I removed all the images from my application except those for the first two screens and the application launched successfully. – Kris Aug 09 '11 at 14:20
  • Rafael, Can you brief how to split the project into several cod file like you said. ? I haven't faced such a scenario before and I'm not much into the BB development...!! Thanks again... – Kris Aug 09 '11 at 15:58
  • 2
    You can create two types of projects. 1 - "Application" type: when compiled produce cod file with application. 2 - "Library": when compiled produce cod file with library. You can create several projects. One - main application project, and one or several library projects. For your case library projects will contain only images and/or other resources. In project settings of main application project specify dependencies, that the main app project needs these library projects to run. When you compile all projects you will get a bunch of cod files. Install them together to a device. That's all. –  Aug 09 '11 at 16:13
  • Type of the project: Application/Library can be set in your "Project settings". –  Aug 09 '11 at 16:15
  • Rafael, How could I mark your comment as the answer ? :-) I couldn't find the option... :-( – Kris Aug 10 '11 at 08:45
  • Comment cannot be marked as answer. Mark [the post](http://stackoverflow.com/questions/6994811/class-not-found-exception-on-launching-application-in-blackberry/6995716#6995716) above. –  Aug 10 '11 at 09:09