-
-
Notifications
You must be signed in to change notification settings - Fork 172
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
ERROR in Android - NoSuchFieldError: No static field INSTANCE of type Lorg/apache/http/conn/ssl/AllowAllHostnameVerifier #444
Comments
I am also facing this same issue when using on Andorid. I know that the root cause of this is AllowAllHostnameVerifier Deprecated. (4.4) on Andorid api level 23+. See https://stackoverflow.com/questions/60423257/no-static-field-instance-of-type-lorg-apache-http-conn-ssl-allowallhostnameverif But what is the solution? |
I tried to solve this by 'shading' please try to use
instead of the htmlunit dependency. You have to add the snapshot repo also
Please report your findings, i really like to get this working on Android and i will support you. But i have not time to set up an android dev at the moment. If it works i will update and release the project. |
It gave me:
I searched this around, this person also had the same problem Is that package public? I didn't find it on the internet |
Please try 2.56.0-SNAPSHOT |
Do you use gradle? |
Yes I'm using gradle. here is the line |
you have to add the snapshot repo and i just made a fix. Please use 2.58.0-SNAPSHOT |
HtmlUnit/htmlunit#444 htmlunit returning lil html page with "error 503 first byte timeout" web scrapping bee also not working giving out : 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!classes2.dex) now im gonna play league of legends or mortal shell, tired of this
I tested the original issue and I can confirm thats its resolved. The issue @p4ulor is facing is unrelated to htmlUnit lib. The website he is trying to hit is too slow. I am simly trying to load google.com and am getting error. My code
Tried some other website and agin getting error.
|
@dshetyo the last one is a different story (and fixable :-)) |
FYI: i just switched to htmlunit-android:2.58.0-SNAPSHOT over here at least all my server side tests are still passing after switching everything from htmlunit to htmlunit-android which leads me to the question if there is any problem to always use htmlunit-android (android as well as any other java runtime on a server or local machine)? @rbri why you differenciate and made an special android release instead of fixing it as part of the general html-unit release? just that i can better understand the decision here :) furthermore i release a snapshot version of my changes at skrape{it} that as said now has htmlunit-android:2.58.0-SNAPSHOT as transitive dependency. i will play around with an android build using this snaopshot version after lunch @p4ulor if you want to you could also try if the snapshot release is doing its job and we thereby fixed your issue here: here is documented how to use the snapshot release: https://github.com/skrapeit/skrape.it#add-experimental-stuff |
Technically there is no difference and you can stay with the android version - it is exactly the same code as the 'real' htmlunit. But there is some flexibility you are loosing because the httpclient is (shaded) included in your jar file and no longer an separate jar. This might be a problem for some users. Will close this issue for now and update the readme a bit. If you like you can have a look at the htmlunit-android readme and report open questions or suggestions. |
ok, thx for clarification. |
I opened a issue #448 |
Hello, I'm getting this on 2.63.0
|
@Cyberavater please try to use https://github.com/HtmlUnit/htmlunit-android |
@black-snow as you already have updated the readme - maybe you can place a link to the android project also. |
Yes, it works nicely now, thanks! |
sure thing, PR incoming |
Hi. Im sorry, but I've been trying to solve this problem for a while now and I really need help because this is frying by brain and eyes. So I would love to have some help.
The error:
The text was updated successfully, but these errors were encountered: