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

java.lang.ClassNotFoundException: com.owncloud.android.lib.common.network.CertificateCombinedException

Open Timoses opened this issue 2 years ago • 8 comments

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

During first start of the Notes app on Android (installed via F-Droid) I am prompted to select the nextcloud profile, then whether I accept the access to nextcloud from nextcloud notes and then I get an error. If I close the app and open it again, I end up with the same.

To Reproduce Steps to reproduce the behavior:

  1. Open app
  2. Click 'Select account'
  3. Select account and press OK
  4. Allow Nextcloud Notes to access Nextcloud when being prompted
  5. Then the error pops up

Expected behavior

Connect to Nextcloud and display notes

Screenshots

Smartphone (please complete the following information): see Stacktrace output

Server

  • Nextcloud version: 25.0.9
  • Nextcloud Notes version (server app): 4.8.1

Stacktrace

App Version: 4.1.0 RC1
App Version Code: 40010051
App Flavor: fdroid

Files App Version Code: 30250090 (PROD)

---

OS Version: 3.18.91-19497840-QB54396082(G930FXXU8EVG3)
OS API Level: 26
Device: herolte
Manufacturer: samsung
Model (and Product): SM-G930F (heroltexx)

---

java.lang.ClassNotFoundException: com.owncloud.android.lib.common.network.CertificateCombinedException
	at java.lang.Class.classForName(Native Method)
	at java.lang.Class.forName(Class.java:453)
	at java.io.ObjectInputStream.resolveClass(ObjectInputStream.java:629)
	at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1616)
	at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1521)
	at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1777)
	at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1354)
	at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:2003)
	at java.io.ObjectInputStream.defaultReadObject(ObjectInputStream.java:504)
	at java.lang.Throwable.readObject(Throwable.java:907)
	at java.lang.reflect.Method.invoke(Native Method)
	at java.io.ObjectStreamClass.invokeReadObject(ObjectStreamClass.java:1006)
	at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1903)
	at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1804)
	at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1354)
	at java.io.ObjectInputStream.readObject(ObjectInputStream.java:374)
	at com.nextcloud.android.sso.api.AidlNetworkRequest.deserializeObjectV2(AidlNetworkRequest.java:245)
	at com.nextcloud.android.sso.api.AidlNetworkRequest.performNetworkRequestV2(AidlNetworkRequest.java:183)
	at com.nextcloud.android.sso.api.NextcloudAPI.performNetworkRequestV2(NextcloudAPI.java:171)
	at com.nextcloud.android.sso.api.NextcloudAPI.lambda$performRequestObservableV2$0$com-nextcloud-android-sso-api-NextcloudAPI(NextcloudAPI.java:113)
	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.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:32)
	at it.niedermann.owncloud.notes.importaccount.ImportAccountActivity.lambda$onActivityResult$5$it-niedermann-owncloud-notes-importaccount-ImportAccountActivity(ImportAccountActivity.java:96)
	at it.niedermann.owncloud.notes.importaccount.ImportAccountActivity$$ExternalSyntheticLambda2.run(Unknown Source:4)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:457)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1162)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:636)
	at java.lang.Thread.run(Thread.java:764)
Caused by: java.lang.ClassNotFoundException: Didn't find class "com.owncloud.android.lib.common.network.CertificateCombinedException" on path: DexPathList[[zip file "/data/app/it.niedermann.owncloud.notes-a7VdT6L0DDV5OTaoSHAtMg==/base.apk"],nativeLibraryDirectories=[/data/app/it.niedermann.owncloud.notes-a7VdT6L0DDV5OTaoSHAtMg==/lib/arm64, /system/lib64, /system/vendor/lib64]]
	at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:93)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:379)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
	... 35 more

Timoses avatar Jul 22 '23 18:07 Timoses

Additional info

Hostname and SAN DNS Names in the x509 cert do not match. This is intended though currently, and I would expect a popup to prompt if I trust the cert.

Not sure if that's of any relevance here.

Timoses avatar Jul 22 '23 18:07 Timoses

If I do not choose from an existing account and select to create a new one, I can successfully log into the nextcloud instance (I am asked whether to trust the certificate). However, I end up in a kind of browser-like view of Nextcloud. I can select the Notes app from the Apps in the header, but I can also do everything else..

I don't believe that is intended? I would expect to see only my notes and a text field to edit the notes in the Notes app. But not the complete Nextcloud browser experience.

Below image is the Notes App. image image

Also, when I then close the Notes app and open it again, the just created account does not appear in the list (maybe because it would be a duplicate of an already existing account; which, when I select that, leads to above error!?).

Timoses avatar Jul 22 '23 19:07 Timoses

References https://github.com/nextcloud/notes-android/issues/961 and https://github.com/nextcloud/Android-SingleSignOn/issues/253

stefan-niedermann avatar Jul 23 '23 15:07 stefan-niedermann

If I do not choose from an existing account and select to create a new one, I can successfully log into the nextcloud instance (I am asked whether to trust the certificate). However, I end up in a kind of browser-like view of Nextcloud.

To summarize: You can not log in with the main Nextcloud Android app successfully?

Having set up a working Nextcloud Android app is mandatory for using the Notes Android app given it uses the Single Sign On feature to pass through network requests.

Please ensure that the Nextcloud Android app works properly before signing in to the Notes Android app and, if necessary, open an issue in the repository of the Nextcloud Android app.

Sorry, but everything else is a follow-up error and can not be fixed on this side.

stefan-niedermann avatar Jul 26 '23 07:07 stefan-niedermann

I did not open the Nextcloud App before using the Notes App. The Nextcloud App always worked.

  1. I opened Nextcloud App (works as usual, no need to sign in again)
  2. Open Notes -> Works

So, I always have to open Nextcloud App before opening Notes? Another error description could be helpful : )

Timoses avatar Jul 26 '23 08:07 Timoses

So, I always have to open Nextcloud App before opening Notes?

No, of course not 😄 So, i misunderstood the quoted part and assumed you are not able to use the Nextcloud app at all - reopening.

stefan-niedermann avatar Jul 26 '23 11:07 stefan-niedermann

Well, after starting Nextcloud App once, it now seems to work.

I restarted my phone and only opened the Notes App. Still works.

I removed the account in Notes App (Select account icon top right, choose handle accounts, then delete the account), reopened again, chose account, granted access (like initially) and it still works (unlike initially).

I removed account in Notes App and this time rebooted phone afterwards. Opened only Notes App after reboot and selected account, granted access and ... still works!

So, I'm having a hard time reproducing the error after https://github.com/nextcloud/notes-android/issues/1849#issuecomment-1651224283

Timoses avatar Jul 26 '23 12:07 Timoses