1

After Updating targetSdkVersion to 31 that required when upload to store, my application crash directly, but it work well when i return it to 30. What can i do to fix it?

compileSdkVersion = 31
targetSdkVersion = 31
buildToolVersion = 30.0.3
gradle = 4.10.1
gradle plugin = 3.3.1
jvm = 1.8
react native version = 0.62.2

justinNg
  • 21
  • 1
  • 5
  • 1
    --> Maybe you can try to change the JVM version to 11. – Ankit Vora Dec 22 '22 at 05:49
  • 1
    You need to upgrade your jdk to version 11 – Adnan sayed Dec 22 '22 at 05:52
  • I tried to change jdk version to 11, but it got some errors: package android does not exist in build tab @Adnansayed – justinNg Dec 22 '22 at 09:20
  • first of all you can change tagetSdkVersion it is note higher then compile SDK version so you can change your target SDK version 31 to 21 i hope this will help you –  Dec 23 '22 at 12:39
  • I did not change the configuration. I solved this issue by adding androidx.work:work-runtime:2.7.0 in app/build.gradle and adding constraints in some modules because they depend on the lower version of work-runtime. Ex: implementation "com.google.android.gms:play-services-analytics:$googlePlayServicesVersion" constraints { implementation('androidx.work:work-runtime:2.7.0') { because 'play-services-ads depends on work-runtime:2.1.0 which is not compatible with targetSdk 31, but work-runtime:2.7.0 is' } } – justinNg Dec 27 '22 at 03:02

0 Answers0