Many similar issues already reported but the solutions provided does not help. After upgrading
rn
to
0.64.2
from
0.63.x
, Android builds (debug and release bundle) crash after making a POST request with
axios
.
07-02 10:12:07.728 10083 30825 E AndroidRuntime: FATAL EXCEPTION: OkHttp Dispatcher
07-02 10:12:07.728 10083 30825 E AndroidRuntime: Process: com.companyapp.communicator, PID: 10083
07-02 10:12:07.728 10083 30825 E AndroidRuntime: java.lang.NoSuchMethodError: No virtual method toString(Z)Ljava/lang/String; in class Lokhttp3/Cookie; or its super classes (declaration of 'okhttp3.Cookie' appears in /data/app/~~2V7cOYCsnfK5qvwogwvJiw==/com.companyapp.communicator-pWzfi8HdeNGGq9jGjSGQZg==/base.apk!classes3.dex)
07-02 10:12:07.728 10083 30825 E AndroidRuntime: at okhttp3.JavaNetCookieJar.saveFromResponse(JavaNetCookieJar.java:45)
07-02 10:12:07.728 10083 30825 E AndroidRuntime: at com.facebook.react.modules.network.ReactCookieJarContainer.saveFromResponse(ReactCookieJarContainer.java:37)
07-02 10:12:07.728 10083 30825 E AndroidRuntime: at okhttp3.internal.http.HttpHeaders.receiveHeaders(HttpHeaders.kt:207)
07-02 10:12:07.728 10083 30825 E AndroidRuntime: at okhttp3.internal.http.BridgeInterceptor.intercept(BridgeInterceptor.kt:85)
07-02 10:12:07.728 10083 30825 E AndroidRuntime: at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:100)
07-02 10:12:07.728 10083 30825 E AndroidRuntime: at okhttp3.internal.http.RetryAndFollowUpInterceptor.intercept(RetryAndFollowUpInterceptor.kt:74)
07-02 10:12:07.728 10083 30825 E AndroidRuntime: at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:100)
07-02 10:12:07.728 10083 30825 E AndroidRuntime: at okhttp3.internal.connection.RealCall.getResponseWithInterceptorChain$okhttp(RealCall.kt:197)
07-02 10:12:07.728 10083 30825 E AndroidRuntime: at okhttp3.internal.connection.RealCall$AsyncCall.run(RealCall.kt:502)
07-02 10:12:07.728 10083 30825 E AndroidRuntime: at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
07-02 10:12:07.728 10083 30825 E AndroidRuntime: at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
07-02 10:12:07.728 10083 30825 E AndroidRuntime: at java.lang.Thread.run(Thread.java:923)
App info
buildToolsVersion = "29.0.3"
minSdkVersion = 21
compileSdkVersion = 29
targetSdkVersion = 29
ndkVersion = "20.1.5948944"
dependencies {
implementation fileTree(dir: "libs", include: ["*.jar"])
//noinspection GradleDynamicVersion
implementation "com.facebook.react:react-native:+" // From node_modules
implementation "androidx.swiperefreshlayout:swiperefreshlayout:1.0.0"
debugImplementation("com.facebook.flipper:flipper:${FLIPPER_VERSION}") {
exclude group:'com.facebook.fbjni'
debugImplementation("com.facebook.flipper:flipper-network-plugin:${FLIPPER_VERSION}") {
exclude group:'com.facebook.flipper'
exclude group:'com.squareup.okhttp3', module:'okhttp'
debugImplementation("com.facebook.flipper:flipper-fresco-plugin:${FLIPPER_VERSION}") {
exclude group:'com.facebook.flipper'
if (enableHermes) {
def hermesPath = "../../node_modules/hermes-engine/android/";
debugImplementation files(hermesPath + "hermes-debug.aar")
releaseImplementation files(hermesPath + "hermes-release.aar")
} else {
implementation jscFlavor
React Native version:
System:
OS: macOS 11.4
CPU: (6) x64 Intel(R) Core(TM) i5-8500B CPU @ 3.00GHz
Memory: 75.36 MB / 16.00 GB
Shell: 3.2.57 - /bin/bash
Binaries:
Node: 12.10.0 - ~/.nvm/versions/node/v12.10.0/bin/node
Yarn: 1.13.0 - /usr/local/bin/yarn
npm: 6.10.3 - ~/.nvm/versions/node/v12.10.0/bin/npm
Watchman: 4.9.0 - /usr/local/bin/watchman
Managers:
CocoaPods: 1.10.1 - /usr/local/bin/pod
SDKs:
iOS SDK:
Platforms: iOS 14.1, DriverKit 19.0, macOS 10.15, tvOS 14.0, watchOS 7.0
Android SDK:
API Levels: 23, 26, 27, 28, 29, 30
Build Tools: 28.0.3, 29.0.2, 29.0.3, 30.0.2
System Images: android-28 | Google APIs Intel x86 Atom, android-28 | Google Play Intel x86 Atom, android-30 | Google APIs Intel x86 Atom
Android NDK: Not Found
IDEs:
Android Studio: 4.1 AI-201.8743.12.41.6953283
Xcode: 12.1/12A7403 - /usr/bin/xcodebuild
Languages:
Java: 1.8.0_201 - /usr/bin/javac
npmPackages:
@react-native-community/cli: Not Found
react: 17.0.1 => 17.0.1
react-native: 0.64.2 => 0.64.2
react-native-macos: Not Found
npmGlobalPackages:
*react-native*: Not Found
hi @sadikyalcin I am facing same problem . tried #27250 soln but its not working. How did u figure out that problem is with this particular library?
Try my comment here Vydia/react-native-background-upload#231 (comment)