When I using both netbeans 6.7.1 and 6.9 to create some j2me based apps it’s stop compiling with the error code:
1 2 3 4 5 | Preverifying 2 file(s) into E:\Play_On\Java\MyLab\mobileApp\mFaraid3\build\preverified directory. Error preverifying class mfaraid.faraidMIDlet java/lang/VerifyError: E:\Play_On\Java\MyLab\mobileApp\mFaraid3\nbproject\build-impl.xml:470: Preverification failed with error code 1. BUILD FAILED (total time: 0 seconds) |
So I began investigating which is land me on some links, here, here, and here. After a few days of figuring out solution, fortunately my apps built again successfully. It happens when I realize my apps use java native floating point library, and I setting it to run on CLDC 1.0 not CLDC 1.1 which is floating point supported by built-in library.
Here is checklist I try to solve this problem:
- Try turning off obfuscation(still got same error).
- Lowering obfuscation level (still got similar error).
- Go to “Libraries & Resources” and uncheck “Netbeans MIDP Components”. as my apps was trying to use WaitingScreen but I canceled it, the netbeans not automatically uncheck the unused library. (still got similar error).
- Checking library used by the apps and matching it to target platform configuration. it was using floating number and java.lang.Math class, and somehow I was unconsciously switching to CLDC 1.0 which’s not support floating number and java.lang.Math class. So I switch back to CLDC 1.1 MIDP 2.0, and it works.
Why netbeans error log not pointing to this matter anyway….?