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

Android app crash when including dixa android #9

Open
bradherman opened this issue Aug 17, 2023 · 7 comments
Open

Android app crash when including dixa android #9

bradherman opened this issue Aug 17, 2023 · 7 comments
Labels
documentation Improvements or additions to documentation

Comments

@bradherman
Copy link

Android app crashes due to the following when including the implementation('com.dixa:messenger-sdk:1.3.2') in build.gradle:

FATAL EXCEPTION: OkHttp Dispatcher
                                                                                                    Process: com.jeevz.jeevz, PID: 6825
                                                                                                    java.lang.NoClassDefFoundError: Failed resolution of: Lokhttp3/internal/Util;
                                                                                                    	at okhttp3.JavaNetCookieJar.decodeHeaderAsJavaNetCookies(JavaNetCookieJar.kt:81)
                                                                                                    	at okhttp3.JavaNetCookieJar.loadForRequest(JavaNetCookieJar.kt:59)
                                                                                                    	at com.facebook.react.modules.network.ReactCookieJarContainer.loadForRequest(ReactCookieJarContainer.java:44)
                                                                                                    	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.internal.connection.RealCall.getResponseWithInterceptorChain$okhttp(RealCall.kt:205)
                                                                                                    	at okhttp3.internal.connection.RealCall$AsyncCall.run(RealCall.kt:533)
                                                                                                    	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/~~keOCHqJYcr1UxTBM0AerbA==/com.jeevz.jeevz-ZD5S8zODfBEGNwcnD2IvEg==/base.apk"],nativeLibraryDirectories=[/data/app/~~keOCHqJYcr1UxTBM0AerbA==/com.jeevz.jeevz-ZD5S8zODfBEGNwcnD2IvEg==/lib/arm64, /data/app/~~keOCHqJYcr1UxTBM0AerbA==/com.jeevz.jeevz-ZD5S8zODfBEGNwcnD2IvEg==/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 com.facebook.react.modules.network.ReactCookieJarContainer.loadForRequest(ReactCookieJarContainer.java:44) 
                                                                                                    	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.internal.connection.RealCall.getResponseWithInterceptorChain$okhttp(RealCall.kt:205) 
                                                                                                    	at okhttp3.internal.connection.RealCall$AsyncCall.run(RealCall.kt:533) 
                                                                                                    	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) 
2023-08-16 17:57:46.563  6825-6983  AndroidRuntime          com.jeevz.jeevz                      E  FATAL EXCEPTION: OkHttp Dispatcher
                                                                                                    Process: com.jeevz.jeevz, PID: 6825
                                                                                                    java.lang.NoClassDefFoundError: Failed resolution of: Lokhttp3/internal/Util;
                                                                                                    	at okhttp3.JavaNetCookieJar.decodeHeaderAsJavaNetCookies(JavaNetCookieJar.kt:81)
                                                                                                    	at okhttp3.JavaNetCookieJar.loadForRequest(JavaNetCookieJar.kt:59)
                                                                                                    	at com.facebook.react.modules.network.ReactCookieJarContainer.loadForRequest(ReactCookieJarContainer.java:44)
                                                                                                    	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.internal.connection.RealCall.getResponseWithInterceptorChain$okhttp(RealCall.kt:205)
                                                                                                    	at okhttp3.internal.connection.RealCall$AsyncCall.run(RealCall.kt:533)
                                                                                                    	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/~~keOCHqJYcr1UxTBM0AerbA==/com.jeevz.jeevz-ZD5S8zODfBEGNwcnD2IvEg==/base.apk"],nativeLibraryDirectories=[/data/app/~~keOCHqJYcr1UxTBM0AerbA==/com.jeevz.jeevz-ZD5S8zODfBEGNwcnD2IvEg==/lib/arm64, /data/app/~~keOCHqJYcr1UxTBM0AerbA==/com.jeevz.jeevz-ZD5S8zODfBEGNwcnD2IvEg==/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 com.facebook.react.modules.network.ReactCookieJarContainer.loadForRequest(ReactCookieJarContainer.java:44) 
                                                                                                    	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.internal.connection.RealCall.getResponseWithInterceptorChain$okhttp(RealCall.kt:205) 
                                                                                                    	at okhttp3.internal.connection.RealCall$AsyncCall.run(RealCall.kt:533) 
                                                                                                    	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) 
@idortulov
Copy link
Contributor

idortulov commented Sep 15, 2023

@bradherman You need to add the dependency for okhttp:

implementation 'com.squareup.okhttp3:okhttp:3.6.0'

@professorkolik
Copy link

@idortulov In RN 0.72.3 OKHTTP_VERSION is 4.9.2, do you think it's safe to downgrade it?

for me acceptable solution was to have following

configurations.all {
    resolutionStrategy.force 'com.squareup.okhttp3:okhttp:4.9.2'
    resolutionStrategy.force 'com.squareup.okhttp3:okhttp-urlconnection:4.9.2'
}

with using the same version as RN

@idortulov
Copy link
Contributor

Yes, this is also acceptable. The root issue was the missing dependency.

@professorkolik
Copy link

@idortulov would be nice to mention it in Readme and update example app 🙏

@Nederby
Copy link
Contributor

Nederby commented Oct 18, 2023

@professorkolik I am more than happy to accept the change to the example app and to the readme file.

@Nederby Nederby added the documentation Improvements or additions to documentation label Oct 18, 2023
@yakupdurmus
Copy link

@idortulov In RN 0.72.3 OKHTTP_VERSION is 4.9.2, do you think it's safe to downgrade it?

for me acceptable solution was to have following

configurations.all {
    resolutionStrategy.force 'com.squareup.okhttp3:okhttp:4.9.2'
    resolutionStrategy.force 'com.squareup.okhttp3:okhttp-urlconnection:4.9.2'
}

with using the same version as RN

I made this change, I can start the first chat on Android side, When I answer on the web pannel I get a network error. Logcat output is as follows.

 E   Throwable: java.lang.NoClassDefFoundError: Failed resolution of: Lorg/jsoup/Jsoup;
                                                                                                    	at com.dixa.messenger.ofs.n6.b(Unknown Source:6)
                                                                                                    	at com.dixa.messenger.ofs.L1.a(Unknown Source:242)
                                                                                                    	at com.dixa.messenger.ofs.L1.a(SourceFile:3)
                                                                                                    	at com.dixa.messenger.ofs.f2$c$a.emit(Unknown Source:71)
                                                                                                    	at kotlinx.coroutines.flow.FlowKt__TransformKt$onEach$$inlined$unsafeTransform$1$2.emit(Emitters.kt:224)
                                                                                                    	at com.dixa.messenger.ofs.R2$b$a.emit(Unknown Source:72)
                                                                                                    	at kotlinx.coroutines.flow.StateFlowImpl.collect(StateFlow.kt:398)
                                                                                                    	at kotlinx.coroutines.flow.StateFlowImpl$collect$1.invokeSuspend(Unknown Source:15)
                                                                                                    	at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
                                                                                                    	at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106)
                                                                                                    	at kotlinx.coroutines.internal.LimitedDispatcher.run(LimitedDispatcher.kt:42)
                                                                                                    	at kotlinx.coroutines.scheduling.TaskImpl.run(Tasks.kt:95)
                                                                                                    	at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:570)
                                                                                                    	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:750)
                                                                                                    	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:677)
                                                                                                    	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:664)
                                                                                                    Caused by: java.lang.ClassNotFoundException: Didn't find class "org.jsoup.Jsoup" on path: DexPathList[[zip file "/data/app/~~66WDdaAFLCigxSeCC5qprQ==/com.justmop.partner-DW8QuXFq22oBODH0Nvf-Rw==/base.apk"],nativeLibraryDirectories=[/data/app/~~66WDdaAFLCigxSeCC5qprQ==/com.justmop.partner-DW8QuXFq22oBODH0Nvf-Rw==/lib/arm64, /data/app/~~66WDdaAFLCigxSeCC5qprQ==/com.justmop.partner-DW8QuXFq22oBODH0Nvf-Rw==/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 com.dixa.messenger.ofs.n6.b(Unknown Source:6) 
                                                                                                    	at com.dixa.messenger.ofs.L1.a(Unknown Source:242) 
                                                                                                    	at com.dixa.messenger.ofs.L1.a(SourceFile:3) 
                                                                                                    	at com.dixa.messenger.ofs.f2$c$a.emit(Unknown Source:71) 
                                                                                                    	at kotlinx.coroutines.flow.FlowKt__TransformKt$onEach$$inlined$unsafeTransform$1$2.emit(Emitters.kt:224) 
                                                                                                    	at com.dixa.messenger.ofs.R2$b$a.emit(Unknown Source:72) 
                                                                                                    	at kotlinx.coroutines.flow.StateFlowImpl.collect(StateFlow.kt:398) 
                                                                                                    	at kotlinx.coroutines.flow.StateFlowImpl$collect$1.invokeSuspend(Unknown Source:15) 
                                                                                                    	at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33) 
                                                                                                    	at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106) 
                                                                                                    	at kotlinx.coroutines.internal.LimitedDispatcher.run(LimitedDispatcher.kt:42) 
                                                                                                    	at kotlinx.coroutines.scheduling.TaskImpl.run(Tasks.kt:95) 
                                                                                                    	at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:570) 
                                                                                                    	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:750) 
                                                                                                    	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:677) 
                                                                                                    	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:664) 

@yakupdurmus
Copy link

@idortulov In RN 0.72.3 OKHTTP_VERSION is 4.9.2, do you think it's safe to downgrade it?
for me acceptable solution was to have following

configurations.all {
    resolutionStrategy.force 'com.squareup.okhttp3:okhttp:4.9.2'
    resolutionStrategy.force 'com.squareup.okhttp3:okhttp-urlconnection:4.9.2'
}

with using the same version as RN

I made this change, I can start the first chat on Android side, When I answer on the web pannel I get a network error. Logcat output is as follows.

 E   Throwable: java.lang.NoClassDefFoundError: Failed resolution of: Lorg/jsoup/Jsoup;
                                                                                                    	at com.dixa.messenger.ofs.n6.b(Unknown Source:6)
                                                                                                    	at com.dixa.messenger.ofs.L1.a(Unknown Source:242)
                                                                                                    	at com.dixa.messenger.ofs.L1.a(SourceFile:3)
                                                                                                    	at com.dixa.messenger.ofs.f2$c$a.emit(Unknown Source:71)
                                                                                                    	at kotlinx.coroutines.flow.FlowKt__TransformKt$onEach$$inlined$unsafeTransform$1$2.emit(Emitters.kt:224)
                                                                                                    	at com.dixa.messenger.ofs.R2$b$a.emit(Unknown Source:72)
                                                                                                    	at kotlinx.coroutines.flow.StateFlowImpl.collect(StateFlow.kt:398)
                                                                                                    	at kotlinx.coroutines.flow.StateFlowImpl$collect$1.invokeSuspend(Unknown Source:15)
                                                                                                    	at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
                                                                                                    	at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106)
                                                                                                    	at kotlinx.coroutines.internal.LimitedDispatcher.run(LimitedDispatcher.kt:42)
                                                                                                    	at kotlinx.coroutines.scheduling.TaskImpl.run(Tasks.kt:95)
                                                                                                    	at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:570)
                                                                                                    	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:750)
                                                                                                    	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:677)
                                                                                                    	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:664)
                                                                                                    Caused by: java.lang.ClassNotFoundException: Didn't find class "org.jsoup.Jsoup" on path: DexPathList[[zip file "/data/app/~~66WDdaAFLCigxSeCC5qprQ==/com.justmop.partner-DW8QuXFq22oBODH0Nvf-Rw==/base.apk"],nativeLibraryDirectories=[/data/app/~~66WDdaAFLCigxSeCC5qprQ==/com.justmop.partner-DW8QuXFq22oBODH0Nvf-Rw==/lib/arm64, /data/app/~~66WDdaAFLCigxSeCC5qprQ==/com.justmop.partner-DW8QuXFq22oBODH0Nvf-Rw==/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 com.dixa.messenger.ofs.n6.b(Unknown Source:6) 
                                                                                                    	at com.dixa.messenger.ofs.L1.a(Unknown Source:242) 
                                                                                                    	at com.dixa.messenger.ofs.L1.a(SourceFile:3) 
                                                                                                    	at com.dixa.messenger.ofs.f2$c$a.emit(Unknown Source:71) 
                                                                                                    	at kotlinx.coroutines.flow.FlowKt__TransformKt$onEach$$inlined$unsafeTransform$1$2.emit(Emitters.kt:224) 
                                                                                                    	at com.dixa.messenger.ofs.R2$b$a.emit(Unknown Source:72) 
                                                                                                    	at kotlinx.coroutines.flow.StateFlowImpl.collect(StateFlow.kt:398) 
                                                                                                    	at kotlinx.coroutines.flow.StateFlowImpl$collect$1.invokeSuspend(Unknown Source:15) 
                                                                                                    	at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33) 
                                                                                                    	at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106) 
                                                                                                    	at kotlinx.coroutines.internal.LimitedDispatcher.run(LimitedDispatcher.kt:42) 
                                                                                                    	at kotlinx.coroutines.scheduling.TaskImpl.run(Tasks.kt:95) 
                                                                                                    	at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:570) 
                                                                                                    	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:750) 
                                                                                                    	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:677) 
                                                                                                    	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:664) 

Instead of this change, I excluded okhttp3 and implemented org.jsoup:jsoup:1.16.1 as follows. it worked for me

    implementation 'org.jsoup:jsoup:1.16.1'
    implementation ('com.dixa:messenger-sdk:1.5.4'){
        exclude group:'com.squareup.okhttp3', module:'okhttp'
    }
    

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

5 participants