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

Android app crashes as soon as opening #13062

Closed
cinder92 opened this issue Mar 21, 2017 · 4 comments
Closed

Android app crashes as soon as opening #13062

cinder92 opened this issue Mar 21, 2017 · 4 comments
Labels
Resolution: Locked This issue was locked by the bot.

Comments

@cinder92
Copy link

cinder92 commented Mar 21, 2017

Description

I can't make my app run.

Reproduction

get project from my partner cloned in bitbucket (in my partner environment the app works like a charm) , after that i do npm i, then try to ran my app and getting following error

03-21 13:42:21.144 20977-21021/com.laRancherita2 E/AndroidRuntime: FATAL EXCEPTION: AsyncTask #2
                                                                   Process: com.laRancherita2, PID: 20977
                                                                   java.lang.RuntimeException: An error occured while executing doInBackground()
                                                                       at android.os.AsyncTask$3.done(AsyncTask.java:300)
                                                                       at java.util.concurrent.FutureTask.finishCompletion(FutureTask.java:355)
                                                                       at java.util.concurrent.FutureTask.setException(FutureTask.java:222)
                                                                       at java.util.concurrent.FutureTask.run(FutureTask.java:242)
                                                                       at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
                                                                       at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
                                                                       at java.lang.Thread.run(Thread.java:818)
                                                                    Caused by: java.lang.NoSuchMethodError: No virtual method setCallWebSocket(Lokhttp3/Call;)V in class Lokhttp3/internal/Internal; or its super classes (declaration of 'okhttp3.internal.Internal' appears in /data/data/com.laRancherita2/files/instant-run/dex/slice-okhttp-3.6.0_4fc54f61c851178d14681b3754ecb1a500425e9b-classes.dex)
                                                                       at okhttp3.ws.WebSocketCall.enqueue(WebSocketCall.java:108)
                                                                       at com.facebook.react.devsupport.InspectorPackagerConnection$Connection.connect(InspectorPackagerConnection.java:243)
                                                                       at com.facebook.react.devsupport.InspectorPackagerConnection.connect(InspectorPackagerConnection.java:44)
                                                                       at com.facebook.react.devsupport.DevServerHelper$3.doInBackground(DevServerHelper.java:159)
                                                                       at com.facebook.react.devsupport.DevServerHelper$3.doInBackground(DevServerHelper.java:155)
                                                                       at android.os.AsyncTask$2.call(AsyncTask.java:288)
                                                                       at java.util.concurrent.FutureTask.run(FutureTask.java:237)
                                                                       at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112) 
                                                                       at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587) 
                                                                       at java.lang.Thread.run(Thread.java:818) 
03-21 13:42:21.146 20977-21020/com.laRancherita2 I/Process: Sending signal. PID: 20977 SIG:9

then, a lot of searching after i saw this issue

then i added this line to my gradle

configurations.all {
        // OkHttp 3.5.0+ includes the websockets API, so we need this to prevent a conflict
        exclude module: 'okhttp-ws'
}

#UPDATE
if i remove code of configurations i'm getting this error

03-21 16:26:39.674 7778-7985/com.laRancherita2 E/AndroidRuntime: FATAL EXCEPTION: AsyncTask #1
                                                                 Process: com.laRancherita2, PID: 7778
                                                                 java.lang.RuntimeException: An error occured while executing doInBackground()
                                                                     at android.os.AsyncTask$3.done(AsyncTask.java:300)
                                                                     at java.util.concurrent.FutureTask.finishCompletion(FutureTask.java:355)
                                                                     at java.util.concurrent.FutureTask.setException(FutureTask.java:222)
                                                                     at java.util.concurrent.FutureTask.run(FutureTask.java:242)
                                                                     at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
                                                                     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
                                                                     at java.lang.Thread.run(Thread.java:818)
                                                                  Caused by: java.lang.NoSuchMethodError: No virtual method setCallWebSocket(Lokhttp3/Call;)V in class Lokhttp3/internal/Internal; or its super classes (declaration of 'okhttp3.internal.Internal' appears in /data/app/com.laRancherita2-1/split_lib_dependencies_apk.apk:classes32.dex)
                                                                     at okhttp3.ws.WebSocketCall.enqueue(WebSocketCall.java:108)
                                                                     at com.facebook.react.devsupport.JSPackagerWebSocketClient.connect(JSPackagerWebSocketClient.java:72)
                                                                     at com.facebook.react.devsupport.DevServerHelper$1.doInBackground(DevServerHelper.java:131)
                                                                     at com.facebook.react.devsupport.DevServerHelper$1.doInBackground(DevServerHelper.java:119)
                                                                     at android.os.AsyncTask$2.call(AsyncTask.java:288)
                                                                     at java.util.concurrent.FutureTask.run(FutureTask.java:237)
                                                                     at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112) 
                                                                     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587) 
                                                                     at java.lang.Thread.run(Thread.java:818) 
03-21 16:26:39.715 7778-7986/com.laRancherita2 I/Process: Sending signal. PID: 7778 SIG: 9

after that i'm getting this issue

03-21 15:49:21.123 6130-6200/com.laRancherita2 E/AndroidRuntime: FATAL EXCEPTION: AsyncTask #1
                                                                 Process: com.laRancherita2, PID: 6130
                                                                 java.lang.RuntimeException: An error occured while executing doInBackground()
                                                                     at android.os.AsyncTask$3.done(AsyncTask.java:300)
                                                                     at java.util.concurrent.FutureTask.finishCompletion(FutureTask.java:355)
                                                                     at java.util.concurrent.FutureTask.setException(FutureTask.java:222)
                                                                     at java.util.concurrent.FutureTask.run(FutureTask.java:242)
                                                                     at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
                                                                     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
                                                                     at java.lang.Thread.run(Thread.java:818)
                                                                  Caused by: java.lang.NoClassDefFoundError: com.facebook.react.devsupport.JSPackagerWebSocketClient
                                                                     at com.facebook.react.devsupport.DevServerHelper$1.doInBackground(DevServerHelper.java:122)
                                                                     at com.facebook.react.devsupport.DevServerHelper$1.doInBackground(DevServerHelper.java:119)
                                                                     at android.os.AsyncTask$2.call(AsyncTask.java:288)
                                                                     at java.util.concurrent.FutureTask.run(FutureTask.java:237)
                                                                     at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112) 
                                                                     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587) 
                                                                     at java.lang.Thread.run(Thread.java:818) 

Solution

Idk

Additional Information

  • React Native version: 0.39
  • Platform: Android (iOS working well at the moment)
  • Operating System: MacOs
  • Dev tools: Android Studio 2.3
@gengjiawen
Copy link
Contributor

gengjiawen commented Apr 25, 2017

Are you using Okhttp 3.5? React native is using Okhttp 3.4, it's not compatible with Okhttp 3.5.

@hramos hramos added the Icebox label Jul 25, 2017
@hramos
Copy link
Contributor

hramos commented Jul 25, 2017

Hi there! This issue is being closed because it has been inactive for a while. Maybe the issue has been fixed in a recent release, or perhaps it is not affecting a lot of people. Either way, we're automatically closing issues after a period of inactivity. Please do not take it personally!

If you think this issue should definitely remain open, please let us know. The following information is helpful when it comes to determining if the issue should be re-opened:

  • Does the issue still reproduce on the latest release candidate? Post a comment with the version you tested.
  • If so, is there any information missing from the bug report? Post a comment with all the information required by the issue template.
  • Is there a pull request that addresses this issue? Post a comment with the PR number so we can follow up.

If you would like to work on a patch to fix the issue, contributions are very welcome! Read through the contribution guide, and feel free to hop into #react-native if you need help planning your contribution.

@hramos hramos closed this as completed Jul 25, 2017
@pencilcheck
Copy link

I have the same issue. Just wondering if the original author solved it and if so how.

@pencilcheck
Copy link

Fixed it with this code: https://stackoverflow.com/questions/43020878/react-native-activity-crashes-probably-related-to-packaging-okhttp3

@facebook facebook locked as resolved and limited conversation to collaborators Jul 25, 2018
@react-native-bot react-native-bot added the Resolution: Locked This issue was locked by the bot. label Jul 25, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Resolution: Locked This issue was locked by the bot.
Projects
None yet
Development

No branches or pull requests

5 participants