zoukankan      html  css  js  c++  java
  • 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" />
  • 相关阅读:
    ExcelManager基于.Net的Excel读写管理类库(二)
    ExcelManager基于.Net的Excel读写管理类库(一)
    NHibernate初探!
    也谈软件工程!
    本人初学WCF ,请教一个问题
    初来咋到,今天终于在这里建起了一个家!
    c#中委托和直接函数调用用什么区别,好处和目的在哪?
    CreateThread, AfxBeginThread,_beginthread, _beginthreadex的区别
    C++线程同步
    C++中using的作用
  • 原文地址:https://www.cnblogs.com/jackyshan/p/4520944.html
Copyright © 2011-2022 走看看