This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
I just upgraded to NB 5.5 beta 2 from 4.1. However, unless I turn Obfuscating OFF, I get a preverify error: Created dir: F:\Netbeans 5.5 projects\MM_midp1_0\build\screen128_128_fromEnToEs\preverified Preverifying 22 file(s) into F:\Netbeans 5.5 projects\MM_midp1_0\build\screen128_128_fromEnToEs\preverified directory. Error preverifying class h VERIFIER ERROR h.a(Ljava/lang/String;)Ljava/lang/String;: Wrong return type in function F:\Netbeans 5.5 projects\MM_midp1_0\nbproject\build-impl.xml:269: Preverification failed with error code 1. BUILD FAILED (total time: 8 seconds) Yet, the same EXACT code without Obfuscation preverifies with no problem: pre-preverify: preverify: Created dir: F:\Netbeans 5.5 projects\MM_midp1_0\build\screen128_128_fromEnToEs\preverified Preverifying 23 file(s) into F:\Netbeans 5.5 projects\MM_midp1_0\build\screen128_128_fromEnToEs\preverified directory. post-preverify: create-jad: add-configuration: add-profile: set-keystore-password: set-alias-password: pre-jar: jar: Building jar: F:\Netbeans 5.5 projects\MM_midp1_0\dist\screen128_128_fromEnToEs\MM2EN1.jar Updating application descriptor: F:\Netbeans 5.5 projects\MM_midp1_0\dist\screen128_128_fromEnToEs\MM2EN1.jad Generated "F:\Netbeans 5.5 projects\MM_midp1_0\dist\screen128_128_fromEnToEs\MM2EN1.jar" is 62297 bytes. post-jar: rebuild: BUILD SUCCESSFUL (total time: 4 seconds) I thought this error was supposed to be fixed with the change in the code doing the preverifying? This is a high priority issue for me because I need to use a version of NB that allows me to add lines to the code that's automatically generated by the visual designer and I also need to obfuscate my code. BTW, when I put the obfuscator on level 1, I get a different error which I don't know how to resolve: Error: You have to specify '-keep' options for the shrinking step. F:\Netbeans 5.5 projects\MM_midp1_0\nbproject\build-impl.xml:260: Obfuscation failed with error code 1. BUILD FAILED (total time: 6 seconds) Thanks, Jade
Level 1 represents empty settings and it is only supposed to be used with custom settings - see the Level description. See http://proguard.sourceforge.net/ for detailed documentation of ProGuard obfuscator. Obfuscation may change application classes to make them smaller. It is possible that obfuscation level is too high and classes are unusable (for instance public method obfuscated, etc). NetBeans 5.5 uses ProGuard 3.5 but latest version is 3.7. Many problems have been fixed since then. I suggest few things: 1. download newer (actually older might help as well) version of proguard and try it. Simply replace {install_dir}/mobility7.3/external/proguard.jar by lib/proguard.jar which is uncluded in ProGuard download zip. Do it on your own risk. 2. try to identify the construction which causes the problem and look at the code. It may be the case of adding extra arguments to ProGuard or it may be a bug. I'm closing the bug as INVALID. If a bug will be added in ProGuard, we should create a new issue - RFE to upgrade ProGuard. If a proguard argument can be found that the obfuscation will work with the application and current version proguard, please reopen this bug. Feel free to use this issue or users@mobility.netbeans.org to further discuss this particular problem with obfuscation.
This might also solve the problem - add it to Additional obfuscation settings. -printmapping "Specifies to print the mapping from old names to new names for classes and class members that have been renamed." -dontusemixedcaseclassnames "Specifies not to generate mixed-case class names while obfuscating. By default, obfuscated class names can contain a mix of upper-case characters and lower-case characters. This creates perfectly acceptable and usable jars. Only if a jar is unpacked on a platform with a case-insensitive filing system (say, Windows), the unpacking tool may let similarly named class files overwrite each other. Code that self-destructs when it's unpacked! Developers who really want to unpack their jars on Windows can use this option to switch off this behavior. Note that the obfuscated jars will become larger as a result. Only applicable when obfuscating."
Thanks for the detailed instructions. I'm downloading a later version of ProGuard now. BTW, do you know which version of ProGuard was used in NB 4.1? That was the last time that I was able to use successfully preverify my obfuscated code. When I tried upgrading to NB 5.0, I ran into this issue. I reported it then and I was told to try a later version of ProGuard--which I didn't have a chance to do.
I downloaded ProGuard 3.7 beta 2 and it worked great the first time. Will you please create a new issue - RFE to upgrade ProGuard? Thanks, Jade
in NetBeans 4.1 there was ProGuard version 3.2 in NetBeans 5.0 and 5.5 beta and 5.5 beta2 it was version 3.3 (we did not use version 3.4 because of some major issues) in NetBeans 5.5 it is version 3.5 and we are going to continue updating ProGuard this way
I also notified ProGuard owner about this issue to give us more clarification on how and when bug was fixed.
http://wiki.netbeans.info/wiki/view/MobilityProguardVersions
done
v
The current version that is installed automatically is 4.4, and the newest stable one is 4.8 (with 4.9b2 available also)