« first day  last day (15 days later) » 

00:00
Too late, already did :(
:)
i am online almost online here. that's fun though
if i be able to help i will
Thanks so much
I will try to fetch it from the maven repository as you said and let you know
ok good luck .
Can you believe that so far I always used jars and never once remote repositories? :)
When you told me to add this implementation 'net.sourceforge.htmlunit:htmlunit:2.36.0'
It was a remote repo from sourceforge, no need to get it from the maven repo right?
yea no need to download the jar
i was like you before i was using jars when i just started dev android apps
00:15
Alright, I'll try, let's hope this time all goes well
it will be fixed
00:33
I still get this error
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!classes3.dex)
dependencies {
//implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation 'androidx.appcompat:appcompat:1.1.0'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
testImplementation 'junit:junit:4.13'
androidTestImplementation 'androidx.test.ext:junit:1.1.1'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'

implementation 'net.sourceforge.htmlunit:htmlunit:2.37.0'
}
this is a good idea
this is not duplicate classes
it's class not found
Because I removed these two lines
implementation 'org.apache.httpcomponents:httpclient-android:4.3.5.1'
implementation 'org.apache.httpcomponents:httpcore:4.3.2'
Otherwise I would get duplicate classes
okay
let's focus on it
add this to your configuration and build again
this:
wait
adding those 2 lines would not same generate same errors because there is not htmlunit-2.36.0-OSGi.jar
Yup
I tried and generates same error
when you do not use any jar why compiler may show there is a jar?
00:39
dependencies {
//implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation 'androidx.appcompat:appcompat:1.1.0'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
testImplementation 'junit:junit:4.13'
androidTestImplementation 'androidx.test.ext:junit:1.1.1'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'

implementation 'net.sourceforge.htmlunit:htmlunit:2.37.0'
implementation 'org.apache.httpcomponents:httpclient-android:4.3.5.1'
implementation 'org.apache.httpcomponents:httpcore:4.4.13'
okay i will post here a configuration
No the compiler is not showing jars right now, only before when I was using it
using what?
The jar
the htmlunit jar
you must not use htmlunit jar because you are implementation 'net.sourceforge.htmlunit:htmlunit:2.37.0'
think those are same
remove it
00:43
Yes I removed it
I said as a matter of fact it's now showing anymore
you mean it's fixed ?
No, I am getting duplicates but not anymore for htmlunit but for jetified I believe
Duplicate class org.apache.http.Consts found in modules jetified-httpclient-android-4.3.5.1.jar (org.apache.httpcomponents:httpclient-android:4.3.5.1) and jetified-httpcore-4.4.13.jar (org.apache.httpcomponents:httpcore:4.4.13)
Duplicate class org.apache.http.ContentTooLongException found in modules jetified-httpclient-android-4.3.5.1.jar (org.apache.httpcomponents:httpclient-android:4.3.5.1) and jetified-httpcore-4.4.13.jar (org.apache.httpcomponents:httpcore:4.4.13)
Duplicate class org.apache.http.HttpConnectionFactory found in modules jetified-httpclient-android-4.3.5.1.jar (org.apache.h
it's good idea
i think in your project there are a lot of bugs
does your project is mulit module ?
No, just one
ok
what is jetified-httpclient-android-4.3.5.1.jar?
there are already tones of jar in your project
00:47
I didn't add this jar
I have no idea
What that is
lol
let's fixed it
okay
honey you there
add this configuration
Yup, I was reading that this jetifier is
configurations {
all {
exclude group: "org.apache.http.auth.*", module: "jetified-httpclient-4.5.11.jar"
}
}
apply plugin: 'com.android.application'

android {
...
defaultConfig {
...
}
buildTypes {
...
}
configurations {
all {
exclude group: "org.apache.http.auth.*", module: "jetified-httpclient-4.5.11.jar"
}
}
Same issue :(
did you add that configuartion ?
00:51
Yes, exactly
that * write rest of the package names where duplicates happens
wildcard *
group: "org.apache.http.HttpConnectionFactory", module: "jetified-httpclient-4.5.11.jar"
Jetified is a collection of libraries with apache libraries already in it, that's why he's telling us of duplicate classes
Where should I add that line?
configurations {
all {
group: "org.apache.http.HttpConnectionFactory", module: "jetified-httpclient-4.5.11.jar"
}
}
for all duplicated classes
You missed an "exclude" before "group", right?
If so, still same error
yea
go to parent folder search all jars
project <- search *.jar
show me jars exists in porject
00:59
gradle-wrapper.jar
out.jar
R.jar
i will post you , i have to reproduce it . i will be contact you .
Ok, thank you so much
01:37
You there
?
i did reproduced the problem
same duplicate classes happened
and i could resolve it
i will post it in OP
test it feed back me
Ok, thank you so very much :)
Sure thing, I will test it immediately
done
Oh, basically you removed the compile options
01:46
did you use compile instead of implementation?
lol
you mean compileOptions
that's right
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
no that's not important i think
So I should leave it?
i think so because it's not important
when you go to project structure
there is a compile option which is set to jdk 8 or 9
you don't need to set it manually
C:\Program Files\Android\Android Studio\jre
project structure -> sdk location -> jdk location
Okay, I removed those lines as well
I am building right now
I am remove this
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
I get this
java.lang.BootstrapMethodError: Exception from call site #4 bootstrap method
6
Q: java.lang.BootstrapMethodError: Exception from call site #2 bootstrap method on CameraX (1.0.0-alpha06)

Peter StaranchukI am trying to use CameraX API to fetch photo, but after I updated to new API version 1.0.0-alpha06 it started to crash on CameraX.bindToLifecycle(...) method. The log of error is: Process: com.aximetria.aximetria.debug, PID: 2629 java.lang.BootstrapMethodError: Exception from call sit...

01:56
restore them :)
I restored them and guess what I get again? :(
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!classes3.dex)
This is a good news
duplication gone
there is just not found class
Yes, duplication is gone
This is a easy to solve exception
just a minute
Ok, thank you
02:00
did you insert 'org.apache.httpcomponents:httpcore:4.3.2'?
with same error
with same version sorry
implementation 'net.sourceforge.htmlunit:htmlunit:2.36.0'
implementation 'org.apache.httpcomponents:httpclient-android:4.3.5.1'
implementation 'org.apache.httpcomponents:httpcore:4.3.2'
there is a newer version update it
4.4.11
Ok will do
'org.apache.httpcomponents:httpcore:4.4.11'
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!classes3.dex)
Same error
02:05
wait
2
A: Using Apache HttpClient with Android SDK 23. NoSuchMethod

Sharp EdgeThe following class has been removed as of API level 22 org.apache.http.conn.ssl.AllowAllHostnameVerifier You can see the removed classes in the official api changes You can use HttpURLConnection class instead. According to official guide This API is more efficient because it reduces net...

your api min api level is 26
Yes is 26
    minSdkVersion 26
You can use HttpURLConnection class instead.
all done ? all fixed ?
But I am not the one who wrote htmlunit
How should I fix it?
I should ask the dev of htmlunit to use httpurlconnection instead?
this is an error inside the code where you are trying to use it
lol
The error is from here:
final HtmlPage page = this.webClient.getPage(LOGIN_URL);
com.gargoylesoftware.htmlunit.html.HtmlPage
I did not write com.gargoylesoftware.htmlunit.html.HtmlPage class
02:14
good news
did you write final HtmlPage page = this.webClient.getPage(LOGIN_URL);?
or it's inside dependency?
no, it's inside the dependecy
ok wait to fix it
how much does it take to build your project?
it take to long for me
not very long for me
Only the first time
was very long
there is not any error for me i mean java.lang.NoSuchFieldError: No static field INSTANCE of type
it looks there is something in your code
is there any link to exception ?
This is the error I get:
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!classes3.dex)
at org.apache.http.conn.ssl.SSLConnectionSocketFactory.<clinit>(SSLConnectionSocketFactory.java:151)
at com.gargoylesoftware.htmlunit.httpclient.HtmlUnitSSLConnectionSocketFactory.buildSSLSocketFactory(HtmlUnitSSLConnectionSocketFactory.java:89)
And this is the code I run:
final HtmlPage page = this.webClient.getPage(LOGIN_URL);
02:30
ok i found
i will post you
Ok, thanks
Use this
WebClient webClient = new WebClient(BrowserVersion.BEST_SUPPORTED);
webClient.getOptions().setJavaScriptEnabled(false);
webClient.getOptions().setUseInsecureSSL(true);
HtmlPage page = webClient.getPage(LOGIN_URL);
Still same issue
make new question related to this problem what you think ?
I already did
Even before the duplicate classes
The duplicate classes error was a result of me trying to fix the issue
02:42
link me
0
Q: No static field INSTANCE of type Lorg/apache/http/conn/ssl/AllowAllHostnameVerifier when using htmlunit in Android Studio Project

DeborahAnnI am using htmlunit 2.36.0 in my Android Studio Project. I successfully compiled the apk but I am getting some runtime errors when I try to get a webpage. Before, I was getting the following error: java.lang.BootstrapMethodError: Exception from call site But I was able to fix the issue by add...

WebClient webClient = new WebClient(BrowserVersion.CHROME);
webClient.getOptions().setJavaScriptEnabled(false);
webClient.getOptions().setUseInsecureSSL(true);
HtmlPage page = webClient.getPage(LOGIN_URL);
BrowserVersion.CHROME
try it
Nope :(
Same issue
ok next solution is probably works
is your url https or http?
02:54
ok
because https need you provide ssl configuration make your post as http
http
then your post won't hit https
unless server redirect your to https
and program won't go to configureHttpsScheme
I tried with http but I get still the same error
because server redirect you to https
it's related to SSL configuration
That's tight
how SSL is set in server
*right
02:58
it's a hard walking through honestly
configuration of SSL
i will be in contact with you
to figure it out how to fix it
Well, you have been very kind
Thank you so much for you help already provided
Even better if you will figure it out
Have a great day ahead
Bye!
because when i needed help there were nice guys who help me .
here is almost night
4 hours late sleeping :)
good luck
Oh, good night then :)
Thanks
I will check OP and the chat in case you figure it out
ok
 
10 hours later…
13:24
hey
lemme explain you
Yea thanks
AllowAllHostnameVerifier is a httpclient instance
it was removed in since version 4.4
Yes, a static instance of httpclient
13:27
htmlunit 2.36.0 uses NoopHostnameVerifier
there is not AllowAllHostnameVerifier
so we have to downgrade to that version that uses AllowAllHostnameVerifier
so we have to downgrade httpclient to 4.3 where AllowAllHostnameVerifier is exists
I understand that in httpclient 4.5 AllowAllHostnameVerifier exists
is there ?
after 4.4>
No, sorry
I mean 4.3
I mean after 4.3 does not exists
actually
httpclient and htmlunit is 2 independent libs
the best settings is what i posted to you
Ok, I will try that settings
But what I meant is
The issue was that AllowAllHostnameVerifier was removed since version 4.4 of httpclient
right?
13:32
yup
Since this exception was triggered it means that htmlunit 2.36.0 is using AllowAllHostnameVerifier and couldn't find it because of httpclient version
If htmlunit 2.36.0 is using NoopHostnameVerifier then should not have triggered that exception, right?
right
Ok, then htmlunit 2.36.0 should work as well with httpclient 4.3
but this might because of IDE compilation limitation that my not let u use @deprecated instances
And there is no need probably to downgrade also htmlunit
Oh you mean the during compilation it does check that httpclient is an older version, while htmlunit is the latest version?
Hence why you downgraded htmlunit as well
?
13:36
yea, exactly
when you downgrade
@deprecate signature will be removed
and compiler let's you use it i think
btw, what i have posted you is the best setting i found
I see, I will try and let you know if everything works out. I will try first with htmlunit 2.36.0 and if it doesn't compile because of deprecation, I will try your setting
ok. i am here
Should I leave this in the gradle?
configurations {
all {
exclude group: "org.apache.httpcomponents", module: "httpclient-android"
}
}
no
it's important
otherwise duplicate class happens
both htmlunit and httpclient have transitive dependencies
Ok, so I should leave it there?
13:42
yea
Ok, I have just tried and with htmlunit 2.36.0 and httpclient 4.3, I still get the same error
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!classes3.dex)
Now I will try to downgrade also htmlunit
ok
It worked :)
:)
glad to hear that
13:58
Thanks so much
you welcome.
any question ?
Nope, now I just have to fix other issues :)
good luck.
bye
Thanks, bye
 
5 hours later…
19:22
Hi
hey
because in your build.gradle you have implemented httpcomponent
i tried to reproduce the gradle same as your settings
if you need httpcomponent you have to set it to 4.3
for newer version exception thrown
if you don't need httpcomponent in your project your can remove it
yea htmlunit is the main implementions
fore newer version of the htmlunit
exception of java.lang.NoSuchFieldError: No static field INSTANCE
throws
but i believe you can use newer version of htmlunit in your code if you do some changes in your project
however, for ur current project in think you should use version of 2.14
something else
the version of 2.15 is better of 2.14 and same result
i would tell you
Okay, I will use 2.15 then
the version of 2.15 is the most use version in libraries
19:30
Is there a way to exclude httpcomponents from the jar jetified?
in the maven repository most of the projects uses 2.15
why you don't remove it?
I don't know how
The libs folder is empty
wait
remove these two lines
implementation 'org.apache.httpcomponents:httpclient:4.3'
implementation 'org.apache.httpcomponents:httpcore:4.3'
19:31
Yes
it doesn't need to exclude them
remove them if you don't need them
Yes, I removed them
Also this, right?
//configurations {
//    all {
//        exclude group: "org.apache.httpcomponents", module: "httpclient-android"
//    }
//}
yea remove it
are you clarified ?
Yeah, thanks
One last question
i hear
19:35
If I wanted to use the last version of htmlunit I would need to exclude the newer versions (4.5) of httpcomponents that are inside this jetified jar and use instead httpcomponents 4.3 that still have the static field instance
But how can I use the version 4.3 and exclude/remove version 4.5?
I don't know how to remove this jetified jar
It was this jar that yesterday night was causing the duplicates
lemme focus
Sure, take your time
deborah
your walking through is wrong
i mean
if you need the newer version of htmlunit
try to code as newer version and use newer approaches
there is not any sense using newer version but code as old fashioned style
the best solution using newer version of htmlunit is compatible the code to newer version
I see, thanks so much again for the help provided
am i clear ?
19:42
Yes, very clear
did you understand well?
any question ?
Yes, I believe so
The reason because does not fire an exception the 2.15 is because does not use that static field instance
yea
Sweet thanks
your welcome. enjoy coding :)
19:49
Thanks, you too :)
Bye
bye

« first day  last day (15 days later) »