-
Notifications
You must be signed in to change notification settings - Fork 7
How to run this proxy server on android platform... getting error of duplicate classess relate to logs while importing it using gradle dependency #17
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
Comments
Hi @aatifansari I suggest to exclude the duplicated libs. I don't know exactly your gradle dependencies, so the solution I suggest is something similar to this approach:
|
Thanks @tkohegyi but when running the application it is giving error..
2023-06-30 16:22:59.017 18869-18869 System.err com.group.sample W java.lang.IllegalStateException: Must set port before starting |
Hi @aatifansari Pls see and follow this guideline on how to start the proxy. |
Hi @tkohegyi Sorry was passing the port in start() method instead of ProxyServer(PORT_NUMBER) constructor. But after that also getting error of INSTANCE static field java.lang.NoSuchFieldError: No static field INSTANCE of type Lorg/apache/http/conn/ssl/AllowAllHostnameVerifier; in class Lorg/apache/http/conn/ssl/AllowAllHostnameVerifier; or its superclasses (declaration of 'org.apache.http.conn.ssl.AllowAllHostnameVerifier' appears in /system/framework/framework.jar!classes4.dex) |
Hi @aatifansari - from the log: Three possible issues might be: In which, in the release notes, there is a note:
AND not the specified version, but a newer version of the lib is used, in which this field is missing. If this is the case, please use exactly the mentioned version of the httpmime lib. case B - You are using newer/latest verison, but overrides (or android overrules) the httpmime component version that is used during the build of the proxy jar. case C - pls see the issue and the solution here: https://stackoverflow.com/questions/60423257/no-static-field-instance-of-type-lorg-apache-http-conn-ssl-allowallhostnameverif In addition - if you can build your own jar from the latest source, maybe the issue will disappear too. |
Hi @tkohegyi thanks for your recommendations Case A - Lowered down the library version Result - But still getting the same error case B - Using the latest library version but not able to verify which version of httpmme/httpclient is being loaded case C - build the jar locally and then imported it. Result - Getting warning during build process and error while running the app. Build process warning - Error - Note - I have also tried to run the application on Intellij and added a class to start the server it is successfully running there and was able to print the port number also. |
Duplicate class org.apache.commons.logging.Log found in modules commons-logging-1.2 (commons-logging:commons-logging:1.2) and jcl-over-slf4j-2.0.6 (org.slf4j:jcl-over-slf4j:2.0.6)
Duplicate class org.apache.commons.logging.LogConfigurationException found in modules commons-logging-1.2 (commons-logging:commons-logging:1.2) and jcl-over-slf4j-2.0.6 (org.slf4j:jcl-over-slf4j:2.0.6)
Duplicate class org.apache.commons.logging.LogFactory found in modules commons-logging-1.2 (commons-logging:commons-logging:1.2) and jcl-over-slf4j-2.0.6 (org.slf4j:jcl-over-slf4j:2.0.6)
Duplicate class org.apache.commons.logging.impl.NoOpLog found in modules commons-logging-1.2 (commons-logging:commons-logging:1.2) and jcl-over-slf4j-2.0.6 (org.slf4j:jcl-over-slf4j:2.0.6)
Duplicate class org.apache.commons.logging.impl.SimpleLog found in modules commons-logging-1.2 (commons-logging:commons-logging:1.2) and jcl-over-slf4j-2.0.6 (org.slf4j:jcl-over-slf4j:2.0.6)
The text was updated successfully, but these errors were encountered: