Android Question does BCToast,BTTextEngine,BCToswv libraries includes okhttputiles2?

Mehrzad238

Active Member
Hello, can anyone explain to me if these libraries include okhttputiles2 as well or if there is something else? When I try to use it, if I am using okhttputiles2, everything is fine, but when I try using retrofit, I am having an error of conflict. I mean, these libraries are text libraries. Why do I have this error?

I know the error says okhttp-3.12.1 and okhttp-4.9.0, and other libraries are used by another library while the okhttputiles2 is not been chosen.
And I know the soulotion I just want to know why?

Error log:

B4X:
Dex merge    Error
Error in c:\sdk3\tools\..\extras\b4a_local\unpacked-amir_retrofit-63685737623860\jars\okhttp-3.12.1.zip:classes.dex:
Type okhttp3.Address is defined multiple times: c:\sdk3\tools\..\extras\b4a_local\unpacked-amir_retrofit-63685737623860\jars\okhttp-3.12.1.zip:classes.dex, C:\SDK3\tools\..\extras\b4a_local\unpacked-okhttp-4.9.0-63872342718000\dex_v1\okhttp-4.9.0.zip:classes.dex
Compilation failed
Exception in thread "main" java.lang.RuntimeException: com.android.tools.r8.CompilationFailedException: Compilation failed to complete, origin: c:\sdk3\tools\..\extras\b4a_local\unpacked-amir_retrofit-63685737623860\jars\okhttp-3.12.1.zip:classes.dex
    at com.android.tools.r8.internal.po.a(R8_8.3.37_d0b8d9dfe8720e37c27d2233931d9d72dbd696ffd92111cc9b36e58b4baad1cc:1269)
    at com.android.tools.r8.D8.main(R8_8.3.37_d0b8d9dfe8720e37c27d2233931d9d72dbd696ffd92111cc9b36e58b4baad1cc:5)
Caused by: com.android.tools.r8.CompilationFailedException: Compilation failed to complete, origin: c:\sdk3\tools\..\extras\b4a_local\unpacked-amir_retrofit-63685737623860\jars\okhttp-3.12.1.zip:classes.dex
    at Version.fakeStackEntry(Version_8.3.37.java:0)
    at com.android.tools.r8.Q.a(R8_8.3.37_d0b8d9dfe8720e37c27d2233931d9d72dbd696ffd92111cc9b36e58b4baad1cc:5)
    at com.android.tools.r8.internal.po.a(R8_8.3.37_d0b8d9dfe8720e37c27d2233931d9d72dbd696ffd92111cc9b36e58b4baad1cc:244)
    at com.android.tools.r8.internal.po.a(R8_8.3.37_d0b8d9dfe8720e37c27d2233931d9d72dbd696ffd92111cc9b36e58b4baad1cc:90)
    at com.android.tools.r8.internal.po.a(R8_8.3.37_d0b8d9dfe8720e37c27d2233931d9d72dbd696ffd92111cc9b36e58b4baad1cc:909)
    at com.android.tools.r8.internal.po.b(R8_8.3.37_d0b8d9dfe8720e37c27d2233931d9d72dbd696ffd92111cc9b36e58b4baad1cc:99)
    at com.android.tools.r8.D8.a(R8_8.3.37_d0b8d9dfe8720e37c27d2233931d9d72dbd696ffd92111cc9b36e58b4baad1cc:1041)
    at com.android.tools.r8.D8.b(R8_8.3.37_d0b8d9dfe8720e37c27d2233931d9d72dbd696ffd92111cc9b36e58b4baad1cc:514)
    at com.android.tools.r8.D8.a(R8_8.3.37_d0b8d9dfe8720e37c27d2233931d9d72dbd696ffd92111cc9b36e58b4baad1cc:1076)
    at com.android.tools.r8.internal.po.a(R8_8.3.37_d0b8d9dfe8720e37c27d2233931d9d72dbd696ffd92111cc9b36e58b4baad1cc:1256)
    ... 1 more
Caused by: com.android.tools.r8.internal.h: Type okhttp3.Address is defined multiple times: c:\sdk3\tools\..\extras\b4a_local\unpacked-amir_retrofit-63685737623860\jars\okhttp-3.12.1.zip:classes.dex, C:\SDK3\tools\..\extras\b4a_local\unpacked-okhttp-4.9.0-63872342718000\dex_v1\okhttp-4.9.0.zip:classes.dex
    at com.android.tools.r8.internal.X30.a(R8_8.3.37_d0b8d9dfe8720e37c27d2233931d9d72dbd696ffd92111cc9b36e58b4baad1cc:346)
    at com.android.tools.r8.internal.pX.a(R8_8.3.37_d0b8d9dfe8720e37c27d2233931d9d72dbd696ffd92111cc9b36e58b4baad1cc:232)
    at com.android.tools.r8.internal.pX.a(R8_8.3.37_d0b8d9dfe8720e37c27d2233931d9d72dbd696ffd92111cc9b36e58b4baad1cc:91)
    at java.base/java.util.concurrent.ConcurrentHashMap.merge(ConcurrentHashMap.java:2056)
    at com.android.tools.r8.internal.pX.a(R8_8.3.37_d0b8d9dfe8720e37c27d2233931d9d72dbd696ffd92111cc9b36e58b4baad1cc:32)
    at com.android.tools.r8.graph.q4$a.d(R8_8.3.37_d0b8d9dfe8720e37c27d2233931d9d72dbd696ffd92111cc9b36e58b4baad1cc:6)
    at com.android.tools.r8.dex.c.a(R8_8.3.37_d0b8d9dfe8720e37c27d2233931d9d72dbd696ffd92111cc9b36e58b4baad1cc:264)
    at com.android.tools.r8.dex.c.a(R8_8.3.37_d0b8d9dfe8720e37c27d2233931d9d72dbd696ffd92111cc9b36e58b4baad1cc:222)
    at com.android.tools.r8.dex.c.a(R8_8.3.37_d0b8d9dfe8720e37c27d2233931d9d72dbd696ffd92111cc9b36e58b4baad1cc:219)
    at com.android.tools.r8.D8.a(R8_8.3.37_d0b8d9dfe8720e37c27d2233931d9d72dbd696ffd92111cc9b36e58b4baad1cc:809)
    at com.android.tools.r8.D8.d(R8_8.3.37_d0b8d9dfe8720e37c27d2233931d9d72dbd696ffd92111cc9b36e58b4baad1cc:212)
    at com.android.tools.r8.D8.c(R8_8.3.37_d0b8d9dfe8720e37c27d2233931d9d72dbd696ffd92111cc9b36e58b4baad1cc:163)
    at com.android.tools.r8.internal.po.a(R8_8.3.37_d0b8d9dfe8720e37c27d2233931d9d72dbd696ffd92111cc9b36e58b4baad1cc:906)
    ... 6 more


1741636189347.png
1741636218786.png


This is happening in all of BC libraries
 

Mehrzad238

Active Member
I know there are much better options—that's not the issue. In fact, there isn't an issue at all. I was just curious and almost got my answer. But what I don't understand is why there's a dependency on OkHttp.

This is a text library, so why should it rely on OkHttp? If it depended on a JavaObject or something similar, that would make sense. If it were a download or upload library, the dependency would also be reasonable. But for a text-processing library? That's the part I don’t quite get. 🤷‍♂️

This is purely out of curiosity 😀 and nothing else.
 
Upvote 0
Top