gnucash-android icon indicating copy to clipboard operation
gnucash-android copied to clipboard

app crashes when switching between different books if recent/favorites selected

Open nikopp opened this issue 9 years ago • 7 comments

Expected behaviour

Switch to selected book.

Actual behaviour

App crashes.

Steps to reproduce the behaviour

  1. Open the app.
  2. Swipe to recent or favorites.
  3. Tap on menu and switch to another book.
  4. Crash.

Software specifications

  • GnuCash Android version: 2.1.1 beta
  • System Android version: 6.0.1
  • Device type: Sony Xperia Z3 compact

nikopp avatar Sep 16 '16 17:09 nikopp

I'm not able to reproduce this on my device (Nexus 5, Android 6). @rivaldi8 can you reproduce this?

codinguser avatar Oct 18 '16 17:10 codinguser

@codinguser: I just produced this crash and sent an error report when I was asked if I want to. Maybe that helps...

nikopp avatar Oct 18 '16 17:10 nikopp

@nikopp yes, it helps. I'll be on the lookout for it. Thanks

codinguser avatar Oct 18 '16 18:10 codinguser

@codinguser I'd swear I reproduced it yesterday, but I'm unable to do so now. As I keep changing branches, maybe it was with another one or under another condition.

@nikopp Are you able to reproduce it always?

rivaldi8 avatar Oct 18 '16 18:10 rivaldi8

@rivaldi8 No. A few weeks ago it happened all the time but now it often works several times before it crashes.

nikopp avatar Oct 18 '16 18:10 nikopp

I now have a new phone and the problem is still there on a Samsung galaxy a3 with Oreo. I sent several crash reports in the past week.

nikopp avatar Jul 13 '18 21:07 nikopp

The problem appeared when switching to Recent or Favorites Account Tab and then opening another Book. The problem did not appear when switching to "All" tab, then opening another book, even having open Recent or Favorites tab before "All" tab.

The Exception was thrown in DatabaseAdapter.getID() by the line : throw new IllegalArgumentException(mTableName + " with GUID " + uid + " does not exist in the db"); because the uid has been built from cursor given in AccountRecyclerAdapter.AccountsListFragment.onBindViewHolderCursor(AccountViewHolder, Cursor), which is a cursor on the previous Book and this uid does not exists in the newly opened Book.

I fixed the issue in (7b6ebb398c89459ffe479d519ee5a69db2449ae9) by removing the content of AccountsActivity.AccountViewPagerAdapter.destroyItem().

I don't know why this fixed the problem, but I found it by discovering that destroyItem() was not called when switching to "All" Tab, but was when switching to Recent or Favorites Tab.

JeanGarf avatar Feb 28 '20 14:02 JeanGarf