Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

React Native App crashes on android 11 on launch without giving error

enter image description here

this is my build.gradle setting and this is my system info enter image description here

I'm trying to run the react native app on android 11 but it is keep crashing on launch without giving any error I have tries almost every solution including setting in build.gradle

buildToolsVersion = "30.0.0"
minSdkVersion = 21
compileSdkVersion = 30
targetSdkVersion = 30
supportLibVersion = "30.0.0"
ndkVersion = "20.1.5948944"
multiDexEnabled = true

setting ** target API to"30" ** in AndroidManifest.xml

the Gradle version I'm using is Gradle plugin version is 4.1.3 Gradle version is 6.7**

please help me find the solution in this regard thanks

like image 636
Samn Avatar asked Jun 15 '21 07:06

Samn


2 Answers

I got an error like this when setting targetSdk version to 30 it's happening because of okhttp version and fixed it by using the latest version

implementation("com.squareup.okhttp3:okhttp:4.9.1")
implementation("com.squareup.okhttp3:okhttp-urlconnection:4.9.1")

add this in your android/app/build.gradle

like image 65
Gigarthan Avatar answered Sep 28 '22 09:09

Gigarthan


This answer has been provided by manohar-octifi (github discussion):

If you are using @sentry/react-native and the version is lower than 2.0.0, then update the version to 2.0.0 or higher (I updated to 2.2.0). This should fix the problem.

like image 39
Yossi Avatar answered Sep 28 '22 09:09

Yossi