开发者

java.lang.NoClassDefFoundError thrown with my own packages in Android 1.5

I have developed an application which has several packages within it's project... A class in one of those packages is called right away in the first line of code, which throws the dreaded java.lang.NoClassDefFoundError error... I don't get it, the package simply is within the project, and it works fine on my Android 1.6 device, but won't wor开发者_如何转开发k with my 1.5 device... I do have to say that the project was originally set for 1.6, but then I changed the within the manifest from 4 to 3... Is that bad practice ? Or maybe it has nothing to do with the platform version ?

Also I do get these lines as wel from the DDMS :

05-04 17:24:59.921: WARN/dalvikvm(2041): VFY: unable to resolve static field 2 (MANUFACTURER) in Landroid/os/Build;
05-04 17:24:59.921: WARN/dalvikvm(2041): VFY:  rejecting opcode 0x62 at 0x0034
05-04 17:24:59.921: WARN/dalvikvm(2041): VFY:  rejected ***/android/managementModule/Management;.getDeviceSpecifics ()V
05-04 17:24:59.921: WARN/dalvikvm(2041): Verifier rejected class ***/android/managementModule/Management;

Thats the ManagementModule which also tries to retrieve several info-fields of the device itself... Again, this works just fine on the 1.6 device, even though thats a development device whilst my 1.5 device is a non-development device...


The verifier didn't change much between 1.5 and 1.6, so it should be equally happy or unhappy on each. (On >= 2.0, it would throw a NoSuchFieldError at the point where the field is first used instead of rejecting the entire class.)

The problem seems to be that the Build.MANUFACTURER field did not exist in Android 1.5 ("Cupcake"). I believe it was introduced in 1.6 ("Donut").

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜