HttpLoggingInterceptor logging = new HttpLoggingInterceptor();
logging.setLevel(HttpLoggingInterceptor.Level.BASIC);
builder.interceptors().add(logging);
java.lang.IllegalStateException: Fatal Exception thrown on Scheduler.Worker thread.
at rx.internal.schedulers.ScheduledAction.run(ScheduledAction.java:62)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:423)
at java.util.concurrent.FutureTask.run(FutureTask.java:237)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:154)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:269)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588)
at java.lang.Thread.run(Thread.java:833)
Caused by: java.lang.NoSuchMethodError: No virtual method log(Ljava/lang/String;)V in class Lokhttp3/internal/Platform; or its super classes (declaration of 'okhttp3.internal.Platform' appears in /data/app/com.ouyangzn.topgithub-2/base.apk)
at okhttp3.logging.HttpLoggingInterceptor$Logger$1.log(HttpLoggingInterceptor.java:109)
at okhttp3.logging.HttpLoggingInterceptor.intercept(HttpLoggingInterceptor.java:157)
at okhttp3.RealCall$ApplicationInterceptorChain.proceed(RealCall.java:190)
at okhttp3.RealCall.getResponseWithInterceptorChain(RealCall.java:163)
at okhttp3.RealCall.execute(RealCall.java:57)
at retrofit2.OkHttpCall.execute(OkHttpCall.java:174)
at retrofit2.adapter.rxjava.RxJavaCallAdapterFactory$RequestArbiter.request(RxJavaCallAdapterFactory.java:171)
at rx.internal.operators.OperatorSubscribeOn$1$1$1$1.call(OperatorSubscribeOn.java:85)
at rx.internal.schedulers.CachedThreadScheduler$EventLoopWorker$1.call(CachedThreadScheduler.java:222)
at rx.internal.schedulers.ScheduledAction.run(ScheduledAction.java:55)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:423)Â
at java.util.concurrent.FutureTask.run(FutureTask.java:237)Â
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:154)Â
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:269)Â
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113)Â
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588)Â
at java.lang.Thread.run(Thread.java:833)Â
You need to use the same version for all of your OK dependencies. If you don’t, things won't work!
I used the same version:
compile "com.squareup.okhttp3:okhttp:${OKHTTP_VERSION}"
compile "com.squareup.okhttp3:logging-interceptor:${OKHTTP_VERSION}"
OKHTTP_VERSION = 3.2.0
Now i kown, the problem is caused by retrofit, i used :
compile "com.squareup.retrofit2:retrofit:${RETROFIT_VERSION}"
RETROFIT_VERSION = 2.1.0
retrofit 2.1.0 used okhttp3.3.0, so ...
I convert retrofit version to 2.0.2, it's ok.
Do not downgrade Retrofit. Upgrade OkHttp.
On Wed, Sep 7, 2016, 1:52 AM ouyangzn [email protected] wrote:
I used the same version:
compile "com.squareup.okhttp3:okhttp:${OKHTTP_VERSION}"
compile "com.squareup.okhttp3:logging-interceptor:${OKHTTP_VERSION}"
OKHTTP_VERSION = 3.2.0Now i kown, the problem is caused by retrofit, i used :
compile "com.squareup.retrofit2:retrofit:${RETROFIT_VERSION}"
RETROFIT_VERSION = 2.1.0retrofit 2.1.0 used okhttp3.3.0, so ...
I convert retrofit version to 2.0.2, it's ok.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
https://github.com/square/okhttp/issues/2839#issuecomment-245182274, or mute
the thread
https://github.com/notifications/unsubscribe-auth/AAEEET1RrHgJuRQa9Lk_Fy5tuLHPXdYyks5qnlE1gaJpZM4J1luG
.
ok , i know, thanks, i was ignore that okhttp's latest version is 3.4.1;
Is there any where to look up which versions work together... I'm getting this with the latest versions of both...
The version of all artifacts from OkHttp should always be the same.
On Wed, Nov 30, 2016 at 4:42 PM Matthew Clark notifications@github.com
wrote:
Is there any where to look up which versions work together... I'm getting
this with the latest versions of both...—
You are receiving this because you commented.Reply to this email directly, view it on GitHub
https://github.com/square/okhttp/issues/2839#issuecomment-264004637, or mute
the thread
https://github.com/notifications/unsubscribe-auth/AAEEEaBtBf6Efw47V-xsq5UtUD2iXc05ks5rDe2_gaJpZM4J1luG
.
I meant what versions of OkHttp that work with what versions of retrofit
Every 3.x version of OkHttp should work with every 2.x version of Retrofit,
but in general, we ensure (and recommend) that the latest versions of each
are always working with each other.
On Wed, Nov 30, 2016 at 4:55 PM Matthew Clark notifications@github.com
wrote:
I meant what versions of OkHttp that work with what versions of retrofit
—
You are receiving this because you commented.Reply to this email directly, view it on GitHub
https://github.com/square/okhttp/issues/2839#issuecomment-264007987, or mute
the thread
https://github.com/notifications/unsubscribe-auth/AAEEEXOarCVeJwyqtsFAwVUcYW8vyEsmks5rDfC8gaJpZM4J1luG
.
def RETROFIT_VERSION = "2.1.0"
compile "com.squareup.retrofit2:retrofit:${RETROFIT_VERSION}"
compile "com.squareup.retrofit2:converter-gson:${RETROFIT_VERSION}"
compile "com.squareup.retrofit2:converter-scalars:${RETROFIT_VERSION}"
compile ("com.squareup.retrofit2:converter-simplexml:${RETROFIT_VERSION}"){
exclude group: 'xpp3', module: 'xpp3'
exclude group: 'stax', module: 'stax-api'
exclude group: 'stax', module: 'stax'
}
def OKHTTP_VERSION = "3.4.2"
compile "com.squareup.okhttp3:okhttp:${OKHTTP_VERSION}"
compile "com.squareup.okhttp3:logging-interceptor:${OKHTTP_VERSION}"
but still getting No virtual method log(Ljava/lang/String;)V in class Lokhttp3/internal/Platform; or its super classes (declaration of 'okhttp3.internal.Platform' appears in /data/app/<package>-2/base.apk)
When I try to use the logging interceptor:
HttpLoggingInterceptor interceptor = new HttpLoggingInterceptor();
interceptor.setLevel(HttpLoggingInterceptor.Level.BODY);
OkHttpClient client = new OkHttpClient.Builder().addInterceptor(interceptor).build();
api = new Retrofit.Builder()
.baseUrl(BASE_URL)
.client(client)
.addConverterFactory(SimpleXmlConverterFactory.create())
.build().create(FeedApi.class);
changed code to
HttpLoggingInterceptor interceptor = new HttpLoggingInterceptor();
interceptor.setLevel(HttpLoggingInterceptor.Level.BODY);
OkHttpClient client = new OkHttpClient.Builder().addInterceptor(interceptor).build();
try {
Response resp = client.newCall(new Request.Builder().url(BASE_URL+"/b2w").build()).execute();
Log.d("MAIN","got resp:"+resp.body().toString());
} catch (IOException e) {
e.printStackTrace();
}
and still getting the same error.
If you run the 'dependencies' task on your module you should be able to see
the resolved versions to make sure they all match.
On Wed, Nov 30, 2016 at 6:24 PM Matthew Clark notifications@github.com
wrote:
changed code to
HttpLoggingInterceptor interceptor = new HttpLoggingInterceptor();
interceptor.setLevel(HttpLoggingInterceptor.Level.BODY);
OkHttpClient client = new OkHttpClient.Builder().addInterceptor(interceptor).build();
try { Response resp = client.newCall(new Request.Builder().url(BASE_URL+"/b2w").build()).execute(); Log.d("MAIN","got resp:"+resp.body().toString()); } catch (IOException e) { e.printStackTrace(); }and still getting the same error.
—
You are receiving this because you commented.Reply to this email directly, view it on GitHub
https://github.com/square/okhttp/issues/2839#issuecomment-264029309, or mute
the thread
https://github.com/notifications/unsubscribe-auth/AAEEEaxxaqiyJS_z9w7cTY_J4z4D-e3Rks5rDgXIgaJpZM4J1luG
.
I believe this is what you meant:

and this was the results:

There is a "Gradle Console" tab in Android Studio, check what's there after
running the task. Or you can do it from Terminal: ./gradlew
:app:dependencies.
On Fri, Dec 2, 2016 at 9:08 AM, Matthew Clark notifications@github.com
wrote:
I believe this is what you meant:
[image: screen shot 2016-12-02 at 12 07 43 am]
https://cloud.githubusercontent.com/assets/484943/20824551/64d0999a-b823-11e6-9057-af648b7cc403.pngand this was the results:
[image: screen shot 2016-12-02 at 12 02 37 am]
https://cloud.githubusercontent.com/assets/484943/20824539/50171420-b823-11e6-9f4e-1267978f34c5.png—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
https://github.com/square/okhttp/issues/2839#issuecomment-264381207, or mute
the thread
https://github.com/notifications/unsubscribe-auth/AA7B3N4SQmXsp_ILvDu5HUHZupRNkjF4ks5rD7XbgaJpZM4J1luG
.
Yeah, it was blank the first run as well...^^;

Command line got me something.... looking through it...
Here is what I'm hoping is the important info from the command line output:
compile - Classpath for compiling the main sources.
+--- io.realm:realm-android-library:2.2.0
| +--- io.realm:realm-annotations:2.2.0
| \--- com.getkeepsafe.relinker:relinker:1.2.2
+--- io.realm:realm-annotations:2.2.0
+--- com.android.support:appcompat-v7:25.0.1
| +--- com.android.support:support-v4:25.0.1
| | +--- com.android.support:support-compat:25.0.1
| | | \--- com.android.support:support-annotations:25.0.1
| | +--- com.android.support:support-media-compat:25.0.1
| | | \--- com.android.support:support-compat:25.0.1 (*)
| | +--- com.android.support:support-core-utils:25.0.1
| | | \--- com.android.support:support-compat:25.0.1 (*)
| | +--- com.android.support:support-core-ui:25.0.1
| | | \--- com.android.support:support-compat:25.0.1 (*)
| | \--- com.android.support:support-fragment:25.0.1
| | +--- com.android.support:support-compat:25.0.1 (*)
| | +--- com.android.support:support-media-compat:25.0.1 (*)
| | +--- com.android.support:support-core-ui:25.0.1 (*)
| | \--- com.android.support:support-core-utils:25.0.1 (*)
| +--- com.android.support:support-vector-drawable:25.0.1
| | \--- com.android.support:support-compat:25.0.1 (*)
| \--- com.android.support:animated-vector-drawable:25.0.1
| \--- com.android.support:support-vector-drawable:25.0.1 (*)
+--- com.android.support:recyclerview-v7:25.0.1
| +--- com.android.support:support-annotations:25.0.1
| +--- com.android.support:support-compat:25.0.1 (*)
| \--- com.android.support:support-core-ui:25.0.1 (*)
+--- com.android.support:cardview-v7:25.0.1
| \--- com.android.support:support-annotations:25.0.1
+--- com.android.support.constraint:constraint-layout:1.0.0-beta4
| \--- com.android.support.constraint:constraint-layout-solver:1.0.0-beta4
+--- com.squareup.retrofit2:retrofit:2.1.0
| \--- com.squareup.okhttp3:okhttp:3.3.0 -> 3.4.2
| \--- com.squareup.okio:okio:1.9.0
+--- com.squareup.retrofit2:converter-gson:2.1.0
| +--- com.squareup.retrofit2:retrofit:2.1.0 (*)
| \--- com.google.code.gson:gson:2.7
+--- com.squareup.retrofit2:converter-scalars:2.1.0
| \--- com.squareup.retrofit2:retrofit:2.1.0 (*)
+--- com.squareup.retrofit2:converter-simplexml:2.1.0
| +--- com.squareup.retrofit2:retrofit:2.1.0 (*)
| \--- org.simpleframework:simple-xml:2.7.1
+--- com.squareup.okhttp3:okhttp:3.4.2 (*)
\--- com.squareup.okhttp3:logging-interceptor:3.4.2
\--- com.squareup.okhttp3:okhttp:3.4.2 (*)
Any ideas? Btw thanks @artem-zinnatullin for pointing the command line out^^
This solution https://github.com/facebook/react-native/issues/27250#issuecomment-561840514 worked for me.
Most helpful comment
You need to use the same version for all of your OK dependencies. If you don’t, things won't work!