kiwix / kiwix-xulrunner

[ARCHIVED] Legacy Kiwix desktop solution for Windows/macOS/Linux
https://download.kiwix.org/release/kiwix-xulrunner/
GNU General Public License v3.0
112 stars 28 forks source link

Uninstalling Android app and then reinstalling causes crash #258

Closed mhutti1 closed 8 years ago

mhutti1 commented 8 years ago

java.lang.RuntimeException: Unable to start activity ComponentInfo{org.kiwix.kiwixmobile/org.kiwix.kiwixmobile.KiwixMobileActivity}: android.database.sqlite.SQLiteException: no such table: Bookmarks (code 1): , while compiling: SELECT DISTINCT Bookmarks.bookmarkStr AS bookmarkStr FROM Bookmarks ORDER BY Bookmarks._id DESC

mhutti1 commented 8 years ago

@EladKeyshawn can you take a look at this as to test after complete reinstall I have to add code to wipe the database in the onCreate method.

EladKeyshawn commented 8 years ago

@mhutti1 Weird... I can't seem to reproduce this problem. Could you please point me on what exactly did you do?

mhutti1 commented 8 years ago

@EladKeyshawn When I am in android studio and run the app. Then exit and manually uninstall the app in android system. Then start app again in android studio I crash.

EladKeyshawn commented 8 years ago

@mhutti1 Exactly as i did right now and it works fine. Are you sure you made an updated pull to your repo? In addition in KiwixDatabase class is there Bookmarks.TABLE in getTables() ?

mhutti1 commented 8 years ago

I think that my database was not being updated correctly. This has fixed it on my end. Remember any structural changes to databases should also include code to upgrade from previous versions.