java.lang.NoClassDefFoundError

时间:2015-05-12 06:51:15

标签: java android noclassdeffounderror

我在Constant_Country类中遇到java.lang.NoClassDefFoundError错误,该错误存在于com.mi.uVite.model包中。

类仍然存在它仍然显示NoClassDefFoundError。我怎样才能克服这个问题?

java.lang.NoClassDefFoundError: com.mi.uVite.model.Constant_Country
        at com.mi.uVite.db.MIDatabaseHandler.createCountryTable(MIDatabaseHandler.java:911)
        at com.mi.uVite.db.MIDatabaseHandler.onCreate(MIDatabaseHandler.java:632)
        at android.database.sqlite.SQLiteOpenHelper.getDatabaseLocked(SQLiteOpenHelper.java:252)
        at android.database.sqlite.SQLiteOpenHelper.getReadableDatabase(SQLiteOpenHelper.java:188)
        at com.mi.uVite.db.MIDatabaseHandler.rowCount(MIDatabaseHandler.java:570)
        at com.mi.uvite.BackGroundIntentService$1.onResponse(BackGroundIntentService.java:110)
        at com.mi.uvite.BackGroundIntentService$1.onResponse(BackGroundIntentService.java:67)
        at com.android.volley.toolbox.StringRequest.deliverResponse(StringRequest.java:60)
        at com.android.volley.toolbox.StringRequest.deliverResponse(StringRequest.java:1)
        at com.android.volley.ExecutorDelivery$ResponseDeliveryRunnable.run(ExecutorDelivery.java:99)
        at android.os.Handler.handleCallback(Handler.java:725)
        at android.os.Handler.dispatchMessage(Handler.java:92)
        at android.os.Looper.loop(Looper.java:137)

并且

public class Constant_Country
{
public static String country_id = "country_id";
public static String country_short_code = "country_short_code";
public static String country_name = "country_name";
public static String country_code = "country_code";
}

1 个答案:

答案 0 :(得分:0)

我认为你必须将类Constant_Country添加到包com.mi.uVite.model并放入Constant_Country的第一行

package com.mi.uVite.model

请记住,如果使用Constant_Country类型的对象,则必须使用导入。