Question One
java.lang.RuntimeException: Unable to start activity ComponentInfo
{com.mapoto4.mapoweather/com.mapoto4.mapoweather.MainActivity}
dbname is empty or not defined in litepal.xml file
分析:数据库字段名错误或者数据库不存在。在Litepal数据库创建之前就调用了聚集函数,比如Count,max等,在源码中能够找到DataSupport.count(xxx.class)的过程中没有走创建数据库的过程,所以报bdname is empty的问题。</br>
解决方法:经过反复的排查,确定了在建立litpal.xml时文件类型产生错误。
网友评论