nextcloud / nextcloud/notes-android

Notes on Android cannot connect to the sever

Open
#3,165 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

0. Needs triage bug
Dominant language
Java
Stars
1.1k
Forks
168
Avg merge
1d 17h
Merged PRs (30d)
31

Description

This issue respects the following points:
Describe the bug

After installing the app and trying to connect to self-hosted server configured in the main Android Nextcloud app, the Notes app throws an error which says something like "wrong answer from the server" and that's it. The app is completely unusable.

Notes apps on the server is working without any issues through web interface.

The main Android Nextcloud app works without issues with the same server and account.

Expected behavior

No response

Notes Android version

33.1.0

Notes server version

5.0.0

Nextcloud Android version

33.1

Nextcloud version

33.0.2

Device

Samsung Galaxy S10

Android Version

12

App Store
  • Google Play Store
  • F-Droid
  • Huawei App Gallery
Stacktrace

App Version: 33.1.0

App Version Code: 330010090

App Flavor: play

Files App Version Code: 330010090 (PROD)

---

OS Version: 4.14.113-25257816(G973FXXSGHWC1)

OS API Level: 31

Device: beyond1

Manufacturer: samsung

Model (and Product): SM-G973F (beyond1lteeea)

---

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:87)

	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:462)

	at java.util.concurrent.FutureTask.run(FutureTask.java:266)

	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)

	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)

	at java.lang.Thread.run(Thread.java:920)

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in CapabilitiesDeserializer.java at line 87 and trace the capabilities response used by CapabilitiesClient.getCapabilities during ImportAccountActivity account import. Reproduce the connection with the reported server setup and verify that importing the account completes without the reported NullPointerException or unusable connection error.

Written by the indexing model from the issue text.

Assessment

Tech stack
android, java
Domain
mobile
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
58/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.