Skip to content
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

java.lang.AbstractMethodError: abstract method "okio.Timeout okhttp3.Call.timeout()" #23882

Closed
wangghon opened this issue Mar 13, 2019 · 6 comments
Labels
Bug 🌐Networking Related to a networking API. Platform: Android Android applications. Resolution: Locked This issue was locked by the bot.

Comments

@wangghon
Copy link

🐛 Bug Report

App crashes on Android when launching after upgraded react native from 0.57.8 to 0.58.6

To Reproduce

E/AndroidRuntime: FATAL EXCEPTION: AsyncTask #2
Process: xxxxx, PID: 6799
java.lang.RuntimeException: An error occurred while executing doInBackground()
at android.os.AsyncTask$3.done(AsyncTask.java:354)
at java.util.concurrent.FutureTask.finishCompletion(FutureTask.java:383)
at java.util.concurrent.FutureTask.setException(FutureTask.java:252)
at java.util.concurrent.FutureTask.run(FutureTask.java:271)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
at java.lang.Thread.run(Thread.java:764)
Caused by: java.lang.AbstractMethodError: abstract method "okio.Timeout okhttp3.Call.timeout()"
at okhttp3.internal.ws.RealWebSocket.connect(RealWebSocket.java:192)
at okhttp3.OkHttpClient.newWebSocket(OkHttpClient.java:435)
at com.facebook.react.devsupport.InspectorPackagerConnection$Connection.connect(InspectorPackagerConnection.java:251)
at com.facebook.react.devsupport.InspectorPackagerConnection.connect(InspectorPackagerConnection.java:52)
at com.facebook.react.devsupport.DevServerHelper$3.doInBackground(DevServerHelper.java:230)
at com.facebook.react.devsupport.DevServerHelper$3.doInBackground(DevServerHelper.java:222)
at android.os.AsyncTask$2.call(AsyncTask.java:333)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167) 
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641) 
at java.lang.Thread.run(Thread.java:764) 
E/AndroidRuntime: FATAL EXCEPTION: AsyncTask #1
Process: xxxxxx, PID: 6799
java.lang.RuntimeException: An error occurred while executing doInBackground()
at android.os.AsyncTask$3.done(AsyncTask.java:354)
at java.util.concurrent.FutureTask.finishCompletion(FutureTask.java:383)
at java.util.concurrent.FutureTask.setException(FutureTask.java:252)
at java.util.concurrent.FutureTask.run(FutureTask.java:271)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
at java.lang.Thread.run(Thread.java:764)
Caused by: java.lang.AbstractMethodError: abstract method "okio.Timeout okhttp3.Call.timeout()"
at okhttp3.internal.ws.RealWebSocket.connect(RealWebSocket.java:192)
at okhttp3.OkHttpClient.newWebSocket(OkHttpClient.java:435)
at com.facebook.react.packagerconnection.ReconnectingWebSocket.connect(ReconnectingWebSocket.java:77)
at com.facebook.react.packagerconnection.JSPackagerClient.init(JSPackagerClient.java:89)
at com.facebook.react.devsupport.DevServerHelper$1.doInBackground(DevServerHelper.java:197)
at com.facebook.react.devsupport.DevServerHelper$1.doInBackground(DevServerHelper.java:151)
at android.os.AsyncTask$2.call(AsyncTask.java:333)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167) 
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641) 
at java.lang.Thread.run(Thread.java:764) 

Expected Behavior

no crash

Environment

React Native Environment Info:
System:
OS: macOS 10.14.2
CPU: (8) x64 Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz
Memory: 41.16 GB / 64.00 GB
Shell: 5.3 - /bin/zsh
Binaries:
Node: 9.10.1 - /usr/local/bin/node
npm: 5.6.0 - /usr/local/bin/npm
Watchman: 4.9.0 - /usr/local/bin/watchman
SDKs:
iOS SDK:
Platforms: iOS 12.1, macOS 10.14, tvOS 12.1, watchOS 5.1
Android SDK:
API Levels: 26, 27, 28
Build Tools: 26.0.1, 26.0.3, 28.0.2, 28.0.3
System Images: android-27 | Google APIs Intel x86 Atom, android-27 | Google Play Intel x86 Atom, android-28 | Google Play Intel x86 Atom, android-28 | Google Play Intel x86 Atom_64
IDEs:
Android Studio: 3.1 AI-173.4819257
Xcode: 10.1/10B61 - /usr/bin/xcodebuild
npmPackages:
react: 16.6.3 => 16.6.3
react-native: 0.58.6 => 0.58.6
npmGlobalPackages:
react-native-cli: 2.0.1

@react-native-bot
Copy link
Collaborator

It looks like you are using an older version of React Native. Please update to the latest release, v0.59 and verify if the issue still exists.

The "Resolution: Old Version" label will be removed automatically once you edit your original post with the results of running react-native info on a project using the latest release.

@dulmandakh dulmandakh added the Platform: Android Android applications. label Mar 17, 2019
@dulmandakh
Copy link
Contributor

Hello there 👋 this issue doesn't have a repro (which means, a react-native init-ed project with the minimal changes that leads to creating the same issue you are reporting). Unfortunately, I have no way of helping you in a meaningful way – there is no easy way for me to recreate the situation and check that the issue reported is still there when changing the code.

Because of this, we are going to close this issue - but if a repro is shared, we are happy to reopen it 🤗

@wangghon
Copy link
Author

According to the link below, the issue could be caused by the change in okhttp.

https://stackoverflow.com/questions/55172551/java-lang-abstractmethoderror-abstract-method-okio-timeout-okhttp3-call-timeou

@aaronisme
Copy link

aaronisme commented Apr 7, 2019

facing the same issue here, after upgrading to latest RN 0.59.3. @wangghon did you just fork the React Native project and build your own ?

@aaronisme
Copy link

after upgrade okHttp to 3.14.0 or downgrading it to 3.11.0, this issue has gone. @dulmandakh seems like an okHttp issue which breaks the react native.

@sapjax
Copy link

sapjax commented Aug 19, 2019

after upgrade okHttp to 3.14.0 or downgrading it to 3.11.0, this issue has gone. @dulmandakh seems like an okHttp issue which breaks the react native.

@aaronisme The okHttp module is prebuilt by react-native, so how to upgrade okHttp to 3.14.0?

@facebook facebook locked as resolved and limited conversation to collaborators Mar 19, 2020
@react-native-bot react-native-bot added the Resolution: Locked This issue was locked by the bot. label Mar 19, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Bug 🌐Networking Related to a networking API. Platform: Android Android applications. Resolution: Locked This issue was locked by the bot.
Projects
None yet
Development

No branches or pull requests

5 participants