Yadhu Krishna
Yadhu Krishna

Reputation: 368

App crashes on Android 11 after targetSdkVersion upgrade to 30 without any error logs

minSdkVersion = 25
compileSdkVersion = 29
targetSdkVersion = 30

It is a React Native project, and the app works well till android 10. issue persist only in android 11.

i tried updating Google WebView which was suggested in a similar issue, but it didnt work..

if anyone have a solution, please share..

Upvotes: 3

Views: 2384

Answers (3)

Md. Mahede hasan
Md. Mahede hasan

Reputation: 173

My app developed old expo code which is sdk 31. We migrate to sdk 33. please check you have also available expo-device and react-native-device-info

1. android->build.gradle
    1. targetSdkVersion = 33
    2. compileSdkVersion = 33
    3. buildToolsVersion = ’33.0.0’


2. android->app->build.gradle
    1. compileSdkVersion safeExtGet("compileSdkVersion", 33)
    2. targetSdkVersion safeExtGet("targetSdkVersion", 33)

expo-device

3. node_modules/expo-device/android/src/main/java/expo/modules/device/DeviceModule.java:105

Replace constants.put("deviceName", Settings.Secure.getString(mContext.getContentResolver(), "bluetooth_name”)); This line to this constants.put("deviceName" , “”);

react-native-device-info

4. node_modules/react-native-device-info/android/src/main/java/com/learning/RNDeviceInfo/RNDeviceModule.java:666

Replace String deviceName = Settings.Global.getString(getReactApplicationContext().getContentResolver(), Settings.Global.DEVICE_NAME); This line to this String deviceName = “”;

Upvotes: 0

Alireza Hadjar
Alireza Hadjar

Reputation: 468

Add this line to your app/build.gradle:

implementation("com.squareup.okhttp3:okhttp:4.9.2")

Edit: Although it is resolved since react native @0.67.2

Upvotes: 4

Paul Ng
Paul Ng

Reputation: 11

Try to upgrade the compileSdkVersion = 30.

The compileSdkVersion should not be lower than the targetSdkVersion.

Upvotes: -2

Related Questions