nextcloud / notes-android

✎ Android client for Nextcloud Notes app.
https://play.google.com/store/apps/details?id=it.niedermann.owncloud.notes
GNU General Public License v3.0
905 stars 132 forks source link

Add an account failed #1623

Closed mescribe0 closed 1 year ago

mescribe0 commented 1 year ago

Please use GitHub reactions 👍 to show that you are affected by the same issue. Please don't comment if you have no relevant information to add!

Describe the bug I have an error message when I add my nextcloud account (see Stacktrace).

To Reproduce Steps to reproduce the behavior:

  1. Launch the app
  2. Clic on "Choose account"
  3. Select the account and click "OK"
  4. See Stacktrace error

Expected behavior Login successfull

Screenshots

Smartphone (please complete the following information):

Server

Stacktrace

App Version: 3.7.1
App Version Code: 3007001
App Flavor: fdroid

Files App Version Code: 30230090

---

OS Version: 5.10.107-android13-4-00004-g6522bf85d262-ab8935228(9104446)
OS API Level: 33
Device: panther
Manufacturer: Google
Model (and Product): Pixel 7 (panther)

---

com.google.gson.JsonSyntaxException: java.lang.IllegalStateException: Expected BEGIN_OBJECT but was NUMBER at line 1 column 5 path $[0]
    at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter.read(ReflectiveTypeAdapterFactory.java:395)
    at com.google.gson.internal.bind.TypeAdapterRuntimeTypeWrapper.read(TypeAdapterRuntimeTypeWrapper.java:40)
    at com.google.gson.internal.bind.CollectionTypeAdapterFactory$Adapter.read(CollectionTypeAdapterFactory.java:82)
    at com.google.gson.internal.bind.CollectionTypeAdapterFactory$Adapter.read(CollectionTypeAdapterFactory.java:61)
    at com.google.gson.Gson.fromJson(Gson.java:1214)
    at com.google.gson.Gson.fromJson(Gson.java:1124)
    at com.google.gson.Gson.fromJson(Gson.java:1094)
    at com.nextcloud.android.sso.api.NextcloudAPI.convertStreamToTargetEntity(NextcloudAPI.java:159)
    at com.nextcloud.android.sso.api.NextcloudAPI.lambda$performRequestObservableV2$1$com-nextcloud-android-sso-api-NextcloudAPI(NextcloudAPI.java:130)
    at com.nextcloud.android.sso.api.NextcloudAPI$$ExternalSyntheticLambda0.subscribe(Unknown Source:6)
    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.ObservableMap.subscribeActual(ObservableMap.java:32)
    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.NotesImportTask.lambda$importNotes$1$it-niedermann-owncloud-notes-persistence-NotesImportTask(NotesImportTask.java:57)
    at it.niedermann.owncloud.notes.persistence.NotesImportTask$$ExternalSyntheticLambda1.run(Unknown Source:6)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:463)
    at java.util.concurrent.FutureTask.run(FutureTask.java:264)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1137)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:637)
    at java.lang.Thread.run(Thread.java:1012)
Caused by: java.lang.IllegalStateException: Expected BEGIN_OBJECT but was NUMBER at line 1 column 5 path $[0]
    at com.google.gson.stream.JsonReader.beginObject(JsonReader.java:393)
    at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter.read(ReflectiveTypeAdapterFactory.java:384)
    ... 24 more
stefan-niedermann commented 1 year ago

Looks like the same general issue as mentiomed in https://github.com/stefan-niedermann/nextcloud-notes/issues/1618

Please check ypur .htaccess file, this is unrelated to the Notes Android App itself.

PoGo606 commented 1 year ago

Hi, this issue occured when we had Rainloop and SnappyMail enabled together. Once one of them is disabled we don't face this problem anymore.