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

Use android-library, streamline dav4jvm

Open tobiasKaminsky opened this issue 3 years ago • 3 comments

This uses

  • https://github.com/nextcloud/android-library/pull/881
  • which uses https://github.com/bitfireAT/dav4jvm/pull/3

This way we can streamline all our dav4jvm classes (and later also our okhttp3 client)

  • [ ] write test

For later:

  • [ ] remove BrowserFile

As always, early feedback is appreciated :-)

tobiasKaminsky avatar Oct 14 '22 05:10 tobiasKaminsky

I currently get a crash at startup;

io.reactivex.exceptions.UndeliverableException: The exception could not be delivered to the consumer because it has already canceled/disposed the flow or the exception has nowhere to go to begin with. Further reading: https://github.com/ReactiveX/RxJava/wiki/What's-different-in-2.0#error-handling | java.lang.NoClassDefFoundError: Failed resolution of: Lokhttp3/internal/Util;
	at io.reactivex.plugins.RxJavaPlugins.onError(RxJavaPlugins.java:367)
	at io.reactivex.internal.schedulers.ScheduledRunnable.run(ScheduledRunnable.java:69)
	at io.reactivex.internal.schedulers.ScheduledRunnable.call(ScheduledRunnable.java:57)
	at java.util.concurrent.FutureTask.run(FutureTask.java:264)
	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:307)
	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.NoClassDefFoundError: Failed resolution of: Lokhttp3/internal/Util;
	at okhttp3.JavaNetCookieJar.decodeHeaderAsJavaNetCookies(JavaNetCookieJar.kt:81)
	at okhttp3.JavaNetCookieJar.loadForRequest(JavaNetCookieJar.kt:59)
	at okhttp3.internal.http.BridgeInterceptor.intercept(BridgeInterceptor.kt:74)
	at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:109)
	at okhttp3.internal.http.RetryAndFollowUpInterceptor.intercept(RetryAndFollowUpInterceptor.kt:65)
	at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:109)
	at okhttp3.logging.HttpLoggingInterceptor.intercept(HttpLoggingInterceptor.kt:221)
	at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:109)
	at com.nextcloud.talk.dagger.modules.RestModule$HeadersInterceptor.intercept(RestModule.java:252)
	at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:109)
	at okhttp3.internal.connection.RealCall.getResponseWithInterceptorChain$okhttp(RealCall.kt:205)
	at okhttp3.internal.connection.RealCall.execute(RealCall.kt:158)
	at retrofit2.OkHttpCall.execute(OkHttpCall.java:204)
	at retrofit2.adapter.rxjava2.CallExecuteObservable.subscribeActual(CallExecuteObservable.java:46)
	at io.reactivex.Observable.subscribe(Observable.java:12284)
	at retrofit2.adapter.rxjava2.BodyObservable.subscribeActual(BodyObservable.java:35)
	at io.reactivex.Observable.subscribe(Observable.java:12284)
	at io.reactivex.internal.operators.observable.ObservableSubscribeOn$SubscribeTask.run(ObservableSubscribeOn.java:96)
	at io.reactivex.Scheduler$DisposeTask.run(Scheduler.java:608)
	at io.reactivex.internal.schedulers.ScheduledRunnable.run(ScheduledRunnable.java:66)
	at io.reactivex.internal.schedulers.ScheduledRunnable.call(ScheduledRunnable.java:57) 
	at java.util.concurrent.FutureTask.run(FutureTask.java:264) 
	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:307) 
	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.ClassNotFoundException: Didn't find class "okhttp3.internal.Util" on path: DexPathList[[zip file "/data/app/~~qX22F70WR-Srw7iu1mv-vA==/com.nextcloud.talk2-VKMvo0R4DnRubOzj3_A-8w==/base.apk"],nativeLibraryDirectories=[/data/app/~~qX22F70WR-Srw7iu1mv-vA==/com.nextcloud.talk2-VKMvo0R4DnRubOzj3_A-8w==/lib/arm64, /data/app/~~qX22F70WR-Srw7iu1mv-vA==/com.nextcloud.talk2-VKMvo0R4DnRubOzj3_A-8w==/base.apk!/lib/arm64-v8a, /system/lib64, /system_ext/lib64]]
	at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:259)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:379)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
	at okhttp3.JavaNetCookieJar.decodeHeaderAsJavaNetCookies(JavaNetCookieJar.kt:81) 
	at okhttp3.JavaNetCookieJar.loadForRequest(JavaNetCookieJar.kt:59) 
	at okhttp3.internal.http.BridgeInterceptor.intercept(BridgeInterceptor.kt:74) 
	at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:109) 
	at okhttp3.internal.http.RetryAndFollowUpInterceptor.intercept(RetryAndFollowUpInterceptor.kt:65) 
	at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:109) 
	at okhttp3.logging.HttpLoggingInterceptor.intercept(HttpLoggingInterceptor.kt:221) 
	at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:109) 
	at com.nextcloud.talk.dagger.modules.RestModule$HeadersInterceptor.intercept(RestModule.java:252) 
	at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:109) 
	at okhttp3.internal.connection.RealCall.getResponseWithInterceptorChain$okhttp(RealCall.kt:205) 
	at okhttp3.internal.connection.RealCall.execute(RealCall.kt:158) 
	at retrofit2.OkHttpCall.execute(OkHttpCall.java:204) 
	at retrofit2.adapter.rxjava2.CallExecuteObservable.subscribeActual(CallExecuteObservable.java:46) 
	at io.reactivex.Observable.subscribe(Observable.java:12284) 
	at retrofit2.adapter.rxjava2.BodyObservable.subscribeActual(BodyObservable.java:35) 
	at io.reactivex.Observable.subscribe(Observable.java:12284) 
	at io.reactivex.internal.operators.observable.ObservableSubscribeOn$SubscribeTask.run(ObservableSubscribeOn.java:96) 
	at io.reactivex.Scheduler$DisposeTask.run(Scheduler.java:608) 
	at io.reactivex.internal.schedulers.ScheduledRunnable.run(ScheduledRunnable.java:66) 
	at io.reactivex.internal.schedulers.ScheduledRunnable.call(ScheduledRunnable.java:57) 
	at java.util.concurrent.FutureTask.run(FutureTask.java:264) 
	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:307) 
	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) 

I suspect this is due to competing okhttp lib versions?

AndyScherzinger avatar Dec 29 '22 19:12 AndyScherzinger

True. It works when I change it to http 5.x branch. Not sure about any side effects…

tobiasKaminsky avatar Jan 04 '23 09:01 tobiasKaminsky

APK file: https://www.kaminsky.me/nc-dev/android-artifacts/2497-talk.apk

qrcode

To test this change/fix you can simply download above APK file and install and test it in parallel to your existing Nextcloud Talk app.

github-actions[bot] avatar Mar 30 '23 20:03 github-actions[bot]