开发者

Java NoClassDefFoundError error on enum

I have an error in my application.

Here is a bit of co开发者_如何学运维de of my class CLog :

enum eType {
    IN,
    OUT,
};
public void function1(String sParams)
{
    _log(sParams, eType.IN);
}

This class is compiled in .jar.

When I call function1 from my app, I get error NoClassDefFoundError :

02-28 17:08:53.853: ERROR/AndroidRuntime(880): java.lang.NoClassDefFoundError: Clog.eType

I don't understand why enum is not found while function1 (class method) is found.


Chances are you've included CLog.class in your apk/jar, but not CLog$eType.class, which is the file that represents the CLog.eType class.

(It would be worth trying to follow Java naming conventions, by the way - which don't include "C for class" and "E for Enum".)

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜