Repository navigation
NullPointerException when choosing account #2959
Copy link
Copy link
Closed as duplicate
Labels
Description
This issue respects the following points:
- I have read the FAQ
- I have searched for existing issues
- The issue affects the Notes Android app, neither the Notes server app nor the Nextcloud Android app.
Describe the bug
- Open the Notes app (after clearing storage and cache in the Android settings)
- Tap "Choose account"
- Select the account and tap "OK"
- Tap "Allow"
- A pop-up shows "Oh no - What now?" with a stacktrace
Expected behavior
After choosing an account and allowing access, I should see the main screen and should be able to list and create notes.
Notes Android version
4.5.2
Notes server version
4.12.4
Nextcloud Android version
3.34.1
Nextcloud version
32.0.0
Device
Fairphone 5 5G
Android Version
15
App Store
- Google Play Store
- F-Droid
- Huawei App Gallery
Stacktrace
App Version: 4.5.2
App Version Code: 40050290
App Flavor: fdroid
Files App Version Code: 30340190 (PROD)
---
OS Version: 5.4.274-qgki-g67a8c76d3b27(VT2F)
OS API Level: 35
Device: FP5
Manufacturer: Fairphone
Model (and Product): FP5 (FP5)
---
java.lang.NullPointerException: Attempt to invoke virtual method 'int com.google.gson.JsonPrimitive.getAsInt()' on a null object reference
at it.niedermann.owncloud.notes.persistence.sync.CapabilitiesDeserializer.deserialize(CapabilitiesDeserializer.java:85)
at it.niedermann.owncloud.notes.persistence.sync.CapabilitiesDeserializer.deserialize(CapabilitiesDeserializer.java:32)
at com.google.gson.internal.bind.TreeTypeAdapter.read(TreeTypeAdapter.java:95)
at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$2.readIntoField(ReflectiveTypeAdapterFactory.java:271)
at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$FieldReflectionAdapter.readField(ReflectiveTypeAdapterFactory.java:559)
at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter.read(ReflectiveTypeAdapterFactory.java:517)
at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$2.readIntoField(ReflectiveTypeAdapterFactory.java:271)
at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$FieldReflectionAdapter.readField(ReflectiveTypeAdapterFactory.java:559)
at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter.read(ReflectiveTypeAdapterFactory.java:517)
at com.google.gson.Gson.fromJson(Gson.java:1358)
at com.google.gson.Gson.fromJson(Gson.java:1259)
at com.google.gson.Gson.fromJson(Gson.java:1227)
at com.nextcloud.android.sso.api.NextcloudAPI.convertStreamToTargetEntity(NextcloudAPI.java:136)
at com.nextcloud.android.sso.api.NextcloudAPI.lambda$performRequestObservableV2$0(NextcloudAPI.java:98)
at com.nextcloud.android.sso.api.NextcloudAPI.$r8$lambda$af7W9mq2B0ZrhVJwZd-ibFp8T3Y(Unknown Source:0)
at com.nextcloud.android.sso.api.NextcloudAPI$$ExternalSyntheticLambda1.subscribe(D8$$SyntheticClass:0)
at io.reactivex.internal.operators.observable.ObservableFromPublisher.subscribeActual(ObservableFromPublisher.java:31)
at io.reactivex.Observable.subscribe(Observable.java:12284)
at io.reactivex.internal.operators.observable.ObservableSingleMaybe.subscribeActual(ObservableSingleMaybe.java:31)
at io.reactivex.Maybe.subscribe(Maybe.java:4290)
at io.reactivex.Maybe.blockingGet(Maybe.java:2320)
at io.reactivex.Observable.blockingSingle(Observable.java:5381)
at it.niedermann.owncloud.notes.persistence.CapabilitiesClient.getCapabilities(CapabilitiesClient.java:38)
at it.niedermann.owncloud.notes.importaccount.ImportAccountActivity.lambda$onActivityResult$5(ImportAccountActivity.java:103)
at it.niedermann.owncloud.notes.importaccount.ImportAccountActivity.$r8$lambda$wIJzzcgrzM9d6k7exwdLMn3GvgQ(Unknown Source:0)
at it.niedermann.owncloud.notes.importaccount.ImportAccountActivity$$ExternalSyntheticLambda4.run(D8$$SyntheticClass:0)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:520)
at java.util.concurrent.FutureTask.run(FutureTask.java:317)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1154)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:652)
at java.lang.Thread.run(Thread.java:1563)
Reactions are currently unavailable
Activity
jvanmalder commentedon Dec 16, 2025
I saw in #855 a request to
curlthe capabilities API and sinceCapabilitiesDeserializeris mentioned in the stacktrace, I tried it:curl 'http://redacted.com/ocs/v2.php/cloud/capabilities?format=json' -H 'OCS-APIRequest: true'I redacted the server hostname and port with "http://redacted.com". Hopefully this is helpful.
jvanmalder commentedon Dec 16, 2025
I fixed it by enabling the Share API (toggle "Allow apps to use the Share API" on at http://your-nextcloud.com/settings/admin/sharing).
Found the solution in #2815 so I'll close this as a duplicate.