Nextcloud-deck: App fails to launch, persistent java.lang.NullPointerException error

Created on 24 Dec 2019  路  9Comments  路  Source: stefan-niedermann/nextcloud-deck

Describe the bug
When I launch the app in an Emulator, more often than not I get an error for a java.lang.NullPointerException.

To Reproduce
Steps to reproduce the behavior:

  1. Launch the app
  2. the error appears seconds after the app launches, all on it's own without any input from me

Expected behavior
The app should open and present my Deck to me

Screenshots
Screenshot from 2019-12-23 20-50-03

Smartphone (please complete the following information):

  • Device: pixel 3a emulated
  • Android-Version: 10

Stacktrace

Version: 0.0.15

java.lang.NullPointerException: Attempt to invoke virtual method 'long java.lang.Long.longValue()' on a null object reference
    at it.niedermann.nextcloud.deck.persistence.sync.helpers.providers.CardDataProvider.goDeeperForUpSync(CardDataProvider.java:195)
    at it.niedermann.nextcloud.deck.persistence.sync.helpers.providers.StackDataProvider.goDeeperForUpSync(StackDataProvider.java:120)
    at it.niedermann.nextcloud.deck.persistence.sync.helpers.providers.BoardDataProvider.goDeeperForUpSync(BoardDataProvider.java:126)
    at it.niedermann.nextcloud.deck.persistence.sync.helpers.SyncHelper.doUpSyncFor(SyncHelper.java:100)
    at it.niedermann.nextcloud.deck.persistence.sync.helpers.SyncHelper.doUpSyncFor(SyncHelper.java:80)
    at it.niedermann.nextcloud.deck.persistence.sync.SyncManager$1.lambda$onResponse$0(SyncManager.java:107)
    at it.niedermann.nextcloud.deck.persistence.sync.-$$Lambda$SyncManager$1$sy1r3klzPK3UdZB5T0drzwhw2Oc.run(Unknown Source:2)
    at java.lang.Thread.run(Thread.java:919)
馃悶 bug

All 9 comments

I've done a bit of poking around and it looks like it relates to when the app loads and the SyncManager calls doUpSyncFor and seems to run into the null point exception. Not my area of expertise, but I'll keep poking around.

So, you have reached Mordor. This is my spooky corner, I'm curious, if you can figure out, what actually happens there.

Just to be absolutely shure: have you built your code upon the latest master or upon the 0.0.14 tag as Stefan mentioned?

I am asking, because I think I know, what happens here. Did you create a label? I thought I fixed that recently...

Here you go:
https://github.com/stefan-niedermann/nextcloud-deck/issues/167#issuecomment-537909408

Please make sure, the last linked commit is included in your version

To be able to work on your feature, you could just delete the app data. If you could just tell me, if you have the Bugfix mentioned above, I'd take care of this one (again 馃槩), since the sync mechanism is quite complicated because of the offline functionality.

I've rebased my local repo on the latest from this github repo and I'm still getting that error. I've also tried deleting every board I have in deck, so it's a completely blank account. I'm still getting this error.
So, corrently, I get this error now every time, and I get it even when there is nothing for the app to load (I have no decks).
Anything I could be looking at here to help fix this?

Yep, as mentioned: delete app data. And by that I don't mean any boards, I mean the setting in Android's app info. Or just uninstall the app via android. After reinstalling the app, it should sync normally.

I already looked up the line, where the Nullpointer is thrown. I guess, a simple nullcheck on the remote IDs of the labels should fix it. But I think I should solve this kind of issue in a more central place if possible, so feel free to just focus on your task.

Sorry for the many bleeding edges you had to face so far, we are working on them! I hope I can solve some issues in my few days off until Thursday.

No worries, slow and steady works for me.
Uninstalling the app from the emulator and starting over works to fix that error, the app launches now. However, I can't create a new board from the app. This may be unrelated to this null pointer issue, so I don't want to drag that into this issue.
Here is a video of what this new issue looks like:
video no board created issue

Weird.. I thought you fixed that @stefan-niedermann?

@randy-jr-olive I'd suggest creating a board and stacks using the web UI for now, so you can work on your feature

Was this page helpful?
0 / 5 - 0 ratings