tinycreative / react-native-intercom

React Native wrapper for Intercom.io
MIT License
407 stars 280 forks source link

RN Android "0.63.4 App Crash #441

Closed michaelVictoriaDev closed 2 years ago

michaelVictoriaDev commented 3 years ago

After config all in the docs, and config the gradle.

 ext {
        buildToolsVersion = '29.0.2'
        minSdkVersion = 26
        compileSdkVersion = 29
        targetSdkVersion = 29
    }

Im having app crash with no errors in my terminal

Then Im starting to check in adb logs , I think the screenshot is saying there's an error in the package.

image

oneji commented 3 years ago

I have the same issue!

molimat commented 3 years ago

I am having an issue like this as well. In my case after just follow up the installation guide, suddenly all my axios requests are returning Network Error and they were just fine before.

akshayLuthraDev commented 3 years ago

I also faced similar issue when using the updated version 21.1.0 (or even 20.0.0). It was running successfully on Android only when I run the app in Debug mode and ENABLE the Network Inspect otherwise the Android app was always crashing as soon as a Network call was hit.

A quick fix for the issue is to downgrade the package to ^18.0.0 and use sdk 7.+ . By using this configuration, Android app won’t crash in release mode but the UI of Intercom screen looks distorted.

Seems like we have to wait to get the latest version of the package fixed to make everything work properly.

akshayLuthraDev commented 3 years ago

Refer this issue thread for details on fixing the crash : https://github.com/tinycreative/react-native-intercom/issues/422

molimat commented 3 years ago

We did fix this updating the okhttp packages in our gradlew, for some reason Intercom and some other libraries were trying to make requests using different okhttp versions, causing crash. Not sure if everyone is having the same issue, but my fix was adding these lines:

dependencies { // define a BOM and its version implementation(platform("com.squareup.okhttp3:okhttp-bom:4.9.0")) // define any required OkHttp artifacts without version implementation("com.squareup.okhttp3:okhttp") implementation("com.squareup.okhttp3:logging-interceptor") }

akshayLuthraDev commented 3 years ago

Thanks @molimat ! Your solution works like a charm.

shanimol commented 3 years ago

We also faced same crash issue with react native insider versions greater than 19.0.0. The above fix mentioned by @molimat fixed the crash issue, but was causing some problems with other libraries already there in our app. So that didn't help us.

Waiting for a permanent fix for this crash problem.

daniel-moya commented 2 years ago

Thanks to @molimat , this solution works!

Also you can check the OkHttp docs where you can find the examples @molimat mentioned

https://square.github.io/okhttp/#releases

    dependencies {
       // Intercom requires okhttp packages to be version compatible
       // For latest release please check: https://square.github.io/okhttp/#releases
       // define a BOM and its version
       implementation(platform("com.squareup.okhttp3:okhttp-bom:4.9.0"))

       // define any required OkHttp artifacts without version
       implementation("com.squareup.okhttp3:okhttp")
       implementation("com.squareup.okhttp3:logging-interceptor")
    }