Respond to malfunctions, probably related to okhttp3 packaging

struggled with this for a week, without success.

I started with a good cooker app (just another app) and added a click with the detailed action being the active React action.

As soon as I click, the whole application will work.

03-25 14: 58: 35.731 2746-4224 / com.justanotherandroidapp.develop E / AndroidRuntime: FATAL EXCEPTION: AsyncTask # 2 Process: com.justanotherandroidapp.develop, PID: 2746 java.lang.RuntimeException: An error occurred while doing doInBackground ( ) at android.os.AsyncTask $ 3.done (AsyncTask.java:325) in java.util.concurrent.FutureTask.finishCompletion (FutureTask.javahaps54) in java.util.concurrent.FutureTask.setException (FutureTask.java:223) in java.util.concurrent.FutureTask.run (FutureTask.java:242) in java.util.concurrent.ThreadPoolExecutor.runWorker (ThreadPoolExecutor.java:1133) in java.util.concurrent.ThreadPoolExecutor $ Worker.run ( .java: 607) in java.lang.Thread.run (Thread.java:761)242) in java.util.concurrent.ThreadPoolExecutor.runWorker (ThreadPoolExecutor.java:1133) in java.util.concurrent.ThreadPoolExecutor $ Worker.run (ThreadPoolExecutor.java:607) in java.lang.Thread.run (Thread.java : 761)242) in java.util.concurrent.ThreadPoolExecutor.runWorker (ThreadPoolExecutor.java:1133) in java.util.concurrent.ThreadPoolExecutor $ Worker.run (ThreadPoolExecutor.java:607) in java.lang.Thread.run (Thread.java : 761)607) in java.lang.Thread.run (Thread.java:761)607) in java.lang.Thread.run (Thread.java:761)                                                                                    Caused: java.lang.NoSuchMethodError: there is no virtual method setCallWebSocket (Lokhttp3 / Call;) V in the class Lokhttp3 / internal / Internal; or its superclasses (the declaration "okhttp3.internal.Internal" appears in /data/app/com.justanotherandroidapp.develop-2/split_lib_dependencies_apk.apk:classes57.dex)                                                                                       in okhttp3.ws.WebSocketCall.enqueue (WebSocketCall.java:8: 10                                                                                     in com.facebook.react.devsupport.InspectorPackagerConnection $ Connection.connect (InspectorPackagerConnection.java:243) in com.facebook.react.devsupport.InspectorPackagerConnection.connect (InspectorPackagerConnection.java:44) in com.facebook.reacteverselsersersersersersersersersersersersersersersersersersersersersersersersersersersersersersersersersersersversversversdevsversversversversversversversversversversverserver $ 3.doInBackground (DevServerHelper.java:168) in com.facebook.react.devsupport.DevServerHelper $ 3.doInBackground (DevServerHelper.java:164) on android.os.AsyncTask $ 2.call (AsyncTask.java.305) in java.util.concurrent.FutureTask.run (FutureTask.java:237) in java.util.concurrent.ThreadPoolExecutor.runWorker (ThreadPoolExecutor.java:1133) in java.util.concurrent.ThreadPoolEx $ Worker.run (ThreadPoolExecutor.java:607) in java.lang.Thread.run (Thread.java:761)237) in java.util.concurrent.ThreadPoolExecutor.runWorker (ThreadPoolExecutor.java:1133) in java.util.concurrent.ThreadPoolExecutor $ Worker.run (ThreadPoolExecutor.java:607) in java.lang.Thread.run (Thread.java : 761)237) in java.util.concurrent.ThreadPoolExecutor.runWorker (ThreadPoolExecutor.java:1133) in java.util.concurrent.ThreadPoolExecutor $ Worker.run (ThreadPoolExecutor.java:607) in java.lang.Thread.run (Thread.java : 761)

                                                                             --------- beginning of system

GitHub https://github.com/vladp/Just-Another-Android-App

ReactNative DevSuportManagerImpl.java( native native 0.42, API 25) 2

  mDevServerHelper.openPackagerConnection(this);
  mDevServerHelper.openInspectorConnection();

( 878, 879 node_modules\response-native\android\com\facebook\react\react-native\0.42.3\react-native-0.42.3-sources.jar!\com\facebook\\devsupport\DevSupportManagerImpl.java)

, okhttp okhttp-ws build.gradle

//React Native  -- start
compile ("com.facebook.react:react-native:0.42.+"){
            // https://github.com/facebook/react-native/issues/10233
            exclude group:'com.facebook.stetho', module:'stetho'
            exclude module: 'jsr305'

}

compile 'com.squareup.okhttp3:okhttp:3.6.0'
compile 'com.squareup.okhttp3:okhttp-ws:3.4.2'

.

+4
1

, . gradle okhttp 3.4.1. , , " " ( 3.4.1 okhttp, native).

configurations.all {
    resolutionStrategy {
        // force certain versions of dependencies (including transitive)
        force 'com.squareup.okhttp3:okhttp:3.4.1'
    }
}

, , , 30 ...

+7

Source: https://habr.com/ru/post/1673202/


All Articles