ActiveAndroid问题no such table解决总结

 android.database.sqlite.SQLiteException: no such table
 at android.database.sqlite.SQLiteConnection.nativePrepareStatement(Native Method)
            at android.database.sqlite.SQLiteConnection.acquirePreparedStatement(SQLiteConnection.java:889)
            at android.database.sqlite.SQLiteConnection.prepare(SQLiteConnection.java:500)
            at android.database.sqlite.SQLiteSession.prepare(SQLiteSession.java:588)
            at android.database.sqlite.SQLiteProgram.<init>(SQLiteProgram.java:58)
            at android.database.sqlite.SQLiteQuery.<init>(SQLiteQuery.java:37)
            at android.database.sqlite.SQLiteDirectCursorDriver.query(SQLiteDirectCursorDriver.java:44)
            at android.database.sqlite.SQLiteDatabase.rawQueryWithFactory(SQLiteDatabase.java:1314)
            at android.database.sqlite.SQLiteDatabase.rawQuery(SQLiteDatabase.java:1253)
            at com.activeandroid.Model.rawQuery(Model.java:349)

 

 

1.模拟器问题,改成真机调试不会有问题

 

2.<meta-data android:name="AA_DB_NAME" android:value="name.db"/>"name.db"的命名不能为你的包名,比如包名为com.sometest.app,不能命名sometest.db

 

3.


<meta-data
android:name="AA_MODELS"
android:value="com.item.android.models.MyModel"/>

 添加model到mainfest.xml

https://github.com/pardom/ActiveAndroid/wiki/Creating-your-database-model

 

Speeding up application startup

ActiveAndroid will look through all your files to find your Model classes. This process can be very slow if you have a lot of dependencies. To speed up this process, specify your Model classes explicitely in your AndroidManifest:

<meta-data     android:name="AA_MODELS"     android:value="com.myapp.model.Item, com.myapp.model.Category" />

你可能感兴趣的:(android)