La aplicación LWUIT no se inicia en un dispositivo Blackberry

Estoy desesperado.

I'm developing an app in LWUIT, using the Resource editor. My project works fine in MIDP version, both in simulator and on devices. But when I find my issue when I start to test my app in Blackberry. The app works perfectly in the simulator but doesn't start in the devices. It doesn't give an error message, doesn't say anything. I try to change the UI_RIM.jar with the jars from LWUIT SVN or with the other jar generated from the Resource editor (UI_RIM_Touch.jar), but nothing changes. I don't know if the htttpConnections or FileConnections could be responsible of this issue. I have 2 Blackberry models, Torch and Bold. Does not work on either.

For developing this app, I'm using Netbeans and LWUIT 1.5

If you need to see some code, tell me what you want and I will post it

Muchas Gracias


Sometimes, I start the app and 30/45 min after appears the next message "uncaught exception thrown in midlet constructor: userclasses.MainMIDlet". I don't know what is the problem.

preguntado el 31 de enero de 12 a las 16:01

1 Respuestas

RIM is hell to work with, I feel your pain... Nombre clave uno will help on that regard.

In general this sounds like one of the following:

  1. You created a MIDlet instead of a UiApplication. Make sure your class derives UiApplication and has a public static void main(String[] args) method which initializes the class. Also make sure that the class is public!

  2. During compilation you didn't define the application as a cldc application and left it as a MIDlet. We edited the build.xml in the resource editor generated files to invoke the proper version.

  3. You compiled with a JDE that is newer than the target device.

Check in the alt-lglg log to see if you have any errors or messages.

Respondido 02 Feb 12, 00:02

Thanks for answer my question @ShaiAlmog. But still not working. I check step 1. I'm using the MIDlet generated by the Resource Editor, and It seems to be OK. In the 2 step, How can I define my app as cldc only? Modifying the build.xml? How?. Step 3: I'm compiling with the JDE 4.2.1. (I need Codename One!!!!!) ;-) - Mun0n

Are you using the MIDlet or the Blackberry application? The Resource Editor generates a blackberry specific application which should work as expected. If you are using 4.2.1 the code will only work on non-touch devices which have OS 4.2.1 and newer. - Shai Almog

I'm using the specific app that is given to me by the Resource editor, but it doesn't work. I'm compiling the app using 4.2 and install it in a BB Bold with OS newer JDE. - Mun0n

If you get the uncaught exception error then your MIDlet is failing with an exception. Finding out why is the true pain and the difference between RIM's implementation and everything else is a huge source of pain. Wrap everything in try catches, log every exception (printStackTrace allows you to see the "stack" in the device log) and make sure that if you have class member fields that they are initialized within the constructor and not in the class e.g. instead of defining a Button b = new Button(); define it as Button b; and initialize later otherwise you can't catch an exception if it fails. - Shai Almog

I tried to do that. But the exception must be inside the StateMachineBase, I think. I try to change the IO and UI given by the Resource Editor and put IO_RIM and UI_RIM from the LWUIT trunk, but I get no improvement. I don't understand why it works in the simulator and doesn't work in the device. I haven't more ideas - Mun0n

No es la respuesta que estás buscando? Examinar otras preguntas etiquetadas or haz tu propia pregunta.