java.lang.NoSuchMethodError: No virtual method getHttpUrlChecked(Ljava/lang/String;)Lokhttp3/HttpUrl
See original GitHub issueHello, everyone.
I am developing an Ionic App (hence I don’t know much about Android).
Recently I am facing a problem since I installed two different cordova plugins which are:
- https://github.com/silkimen/cordova-plugin-advanced-http
- https://github.com/situmtech/situm-cordova-plugin
When I install these two plugins and make a HTTP request, I get the following error:
java.lang.NoSuchMethodError: No virtual method getHttpUrlChecked(Ljava/lang/String;)Lokhttp3/HttpUrl; in class Lokhttp3/internal/Internal; or its super classes (declaration of 'okhttp3.internal.Internal' appears in /data/app/es.sanitas.hospitales.portalpaciente-1/base.apk)
at okhttp3.internal.huc.OkHttpURLConnection.buildCall(OkHttpURLConnection.java:373)
at okhttp3.internal.huc.OkHttpURLConnection.getResponse(OkHttpURLConnection.java:435)
at okhttp3.internal.huc.OkHttpURLConnection.getResponseCode(OkHttpURLConnection.java:491)
at okhttp3.internal.huc.DelegatingHttpsURLConnection.getResponseCode(DelegatingHttpsURLConnection.java:106)
at okhttp3.internal.huc.OkHttpsURLConnection.getResponseCode(OkHttpsURLConnection.java:26)
at com.github.kevinsawicki.http.HttpRequest.code(HttpRequest.java:1758)
at com.synconset.cordovahttp.CordovaHttp.returnResponseObject(CordovaHttp.java:247)
at com.synconset.cordovahttp.CordovaHttpGet.run(CordovaHttpGet.java:30)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1133)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:607)
at java.lang.Thread.run(Thread.java:776)
In the second plugin I’ve read that it uses proguard and that it could cause some problems so I modified it as I read as follows (but the problem is not gone):
# Add project specific ProGuard rules here.
# You can control the set of applied configuration files using the
# proguardFiles setting in build.gradle.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html
-keepattributes Signature
-keepattributes Annotation
-keep class okhttp3.** { *; }
-keep interface okhttp3.** { *; }
-dontwarn okhttp3.**
-dontwarn okio.**
# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
-keepclassmembers class fqcn.of.javascript.interface.for.webview {
public *;
}
# Uncomment this to preserve the line number information for
# debugging stack traces.
-keepattributes SourceFile,LineNumberTable
# If you keep the line number information, uncomment this to
# hide the original source file name.
-renamesourcefileattribute SourceFile
Could anyone please give me a hand with this?
I’ve been a couple days with this problem and cant find out how to fix it. Please, help.
Thanks.
Issue Analytics
- State:
- Created 5 years ago
- Comments:8 (3 by maintainers)
Top Results From Across the Web
java.lang.NoSuchMethodError: No virtual method toString(Z ...
You're pulling in an old version of okhttp-urlconnection, and it is incompatible with the current version of the OkHttp core library.
Read more >java.lang.NoSuchMethodError No virtual method log(ILjava ...
NoSuchMethodError : No virtual method log(ILjava/lang/String;Ljava/lang/Throwable;)V in class Lokhttp3/internal/platform/Platform; ...
Read more >java.lang.NoSuchMethodError: No virtual method log(ILjava ...
java.lang.NoSuchMethodError: No virtual method log(ILjava/lang/String;Ljava/lang/Throwable;)V in class Lokhttp3/internal/platform/Platform; ...
Read more >No virtual method load(Ljava/lang/String;)Lcom/squareup ...
Hello, I am using picasso library (link) for my imageview in my customlistview and it is working great. I am also using in...
Read more >OutSystems Community
java.lang.NoSuchMethodError: No virtual method getHttpUrlChecked(Ljava/lang/String;)Lokhttp3/HttpUrl; in class Lokhttp3/internal/Internal; ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
in my case, the problem was Firebase dependencies, i fix with this solution for every Firebase implementation.
@Keepertje make sure every OkHttp dependency is on the same OkHttp version. If you want you can use a platform dependency to make this easy: