07-21-2008 10:06 AM - edited 07-21-2008 10:09 AM
I got a MIDlet based application using some RIM API (keyboard detection, catch menu key, ...). The Application was working fine until recently when we did add some news screens.
When running the application on the simulator, we received a "verification error".
After various test, I found out that moving my "lngConst" static class from the Mylib.jar to MyProject did solve (temporally) the problem. (the only real diffence was the "import lib.LngConst" removed from a few files. I did notice that this small difference provokes a different separation of the sub-cod : 2 bigger sub-cod (not working) VS 3 smaller ones (working) )
But when adding new code, the simulator refuses to load the application (freez on "linking java" ) on the first run. On the second, the application execute fine. BUT if I deploy the application on a device, the device gets stuck in a reboot loop!
by changing some stuff in my code (remove debug code, move class from one packet to an other, adding/removing/changing obfuscation) I can "switch" between the two device's behaviours : Verification error VS reboot loop after deploy. But it is always one or the other. :-C
The only solution I found was to reduce the cod size to his old size (it's working up to ~166K, bigger .cod do not work). Obviously, this is NOT a solution, since I cannot add the new features to the application... (with new features : ~210k)
I spend the last few days making blind test in the hope of understanding what is posing problems... ANY help will be VERY appreciated.
Thanks in advance,
JDE 4.2.1 / Sim model 8800 (try also with 8100)
device: BB 8800 Platform 18.104.22.168, App: 22.214.171.124
Verification error number was usually 1426, sometimes 2850, 1810, 2674. In the module without number (AppName.cod not appName-x.cod)
The project import 3 different lib.jar
The project work fine on Nokia & Sony Ericsson devices.
I compile the jar (with the lib inside) with NetBeans, then make a cod with rapc.
I do not use API which required a signed application (desactived by a define during development)
I tried with JDE 4.3 : same result.
I tried with a BB 8100 : same result.
I tried to deploy OTA or with javaloader / ALX : same result.
My Midlet is public and not obfuscated.
PS: I call "sub-cod" the .codS which are inside the "zip" .cod.
07-22-2008 07:52 AM
the only way I found is to create a JDE WS with one (library)project by imported jar and one normal (mildet) project for the rest of the code. Then use the JDE EDI to compile the codS (how practical...).
Note that in fct of the realtive path of the .jdp and the .jdw, the image path in the compiled .cod may be empty or not (and so, you may need to adapt the Image.createImage() ).
I m very interested in any other solution (I got a lot of project configuration and I don't feel like creating 20 JDE project files)
07-25-2008 07:46 AM
Note that in fct of the realtive path of the
.jdp and the .jdw .rapc, the image path in the compiled .cod may be empty or not (and so, you may need to adapt the Image.createImage() ).
07-29-2008 05:29 AM
well.... I am still fighting with the rapc compiler to try to convert my working jar in a valid cod.
I know this issue was encounter by many peoples (I found some article, blog and comment about this), but the only proposed solution was "random modifications of your code until its working again". I also try to light some incense and made a small pray, but this did not prove efficient either... :-(
any idea about the cause of this issue ?
PS: With the last version of my sources, sometimes, the cod is valide and I can load it in the simulator without error.
07-29-2008 10:28 AM
Please see the following developers knowledge base article.
Support - MIDlet has verification error at offset
07-29-2008 11:21 AM
The Application was working fine until recently when we did add some news screens.
The only solution I found was to reduce the cod size to his old size
My Midlet is public and not obfuscated.
I could add that I do not sign the .cod (cause I do not use secure API during dev.)
The "variable"/factor which provoc the problem is not a "public MIDlet"/Obfuscation issue.
12-04-2008 05:57 AM
Hi all, I have a problem similar to the Christophe's.
I have a midled developed in Netbeans (without use of rim api) this midlet has a number of embedden images (.png) their total size is 160Kb, and the size of each image do not exceed 20Kb. The code size is about 200kb. I need to run this midled in an 8800 device, so i'm using JDE 4.2.1.
I'have tried to compile the jar file into cod using the command line tools (preverify and rapc), and I got an error like:
Error starting myApp: Module "myApp-2" has verification error 1426 at offset 019f
In both emulator and real device. I got the same error even using JDE to build the cod (following the relative knowledge base document).
The midlet run if I remove some part of code (any without preferences) or remove image files from the package, so it seem to be an error related to the cod packaging , not to the midlet code (that runs fine on a number of different hansets).
Any hint will be very appreciated!
12-04-2008 06:13 AM
At the end, I used a batch to compile the project to a .cod.
0. create by hand a .rapc for each config (basicaly a copy of the .jad file)
1. compile with netbeans
2. compile the "preprocessed" files from netbeans with a batch which call the rapc.exe (create a dyn file list, copy eventual lib .java files)
don't forget to import your lib .cod converted from .jar and the net_rim_api.jar
/!\ the .rapc file MUST be in the root folder of your source files ( "preprocessed" folder) if not, the image path will be wrong.
I spend a few day to get a working batch with all my config and I had to manage pretty much name issues. But it is possible.
I'am very busy, but wishing to help you if you get blocked. just post here.
good luck !
PS: for info, my batches are 14k with comments.
12-29-2008 06:31 AM
Thank you, I have follow your suggestions and solved my problem.
I have recompiled all my sources (libraryes included) with RAPC, to do this I have used this useful set of ant tasks: http://bb-ant-tools.sourceforge.net/
03-02-2009 07:52 AM
oh yes, I forgot about this bb-ant-tools.
I don't remeber why, but I encounter some limitations with this tools. (which is why I made my batch system).
glad I could help you.