Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use android-library, streamline dav4jvm #2497

Draft
wants to merge 5 commits into
base: master
Choose a base branch
from
Draft

Conversation

tobiasKaminsky
Copy link
Member

@tobiasKaminsky tobiasKaminsky commented Oct 14, 2022

This uses

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

@AndyScherzinger
Copy link
Member

AndyScherzinger commented Dec 29, 2022

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?

@tobiasKaminsky
Copy link
Member Author

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

@github-actions
Copy link

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.

Signed-off-by: tobiasKaminsky <tobias@kaminsky.me>
Signed-off-by: tobiasKaminsky <tobias@kaminsky.me>
Signed-off-by: tobiasKaminsky <tobias@kaminsky.me>
Signed-off-by: tobiasKaminsky <tobias@kaminsky.me>
Signed-off-by: tobiasKaminsky <tobias@kaminsky.me>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants