I am trying to migrate my app from api level 33
to 34
, I am using gradle version 8.0.0
, and jdk 17
it is returning an error when I am trying to build.
package.json
"dependencies":{
"@notifee/react-native":"^7.6.1",
"@react-native-async-storage/async-storage":"^1.17.7",
"@react-native-community/checkbox":"0.5.12",
"@react-native-community/netinfo":"^9.3.7",
"@react-native-firebase/app":"16.2.0",
"@react-native-firebase/crashlytics":"^17.4.1",
"@react-native-firebase/messaging":"16.2.0",
"@react-native-masked-view/masked-view":"^0.2.7",
"@react-navigation/bottom-tabs":"^6.3.2",
"@react-navigation/native":"^6.0.11",
"@react-navigation/stack":"^6.2.2",
"@reduxjs/toolkit":"^1.8.3",
"axios":"^1.3.4",
"i18next":"^21.8.14",
"lodash":"^4.17.21",
"moment-timezone":"^0.5.41",
"paper":"^0.12.17",
"prop-types":"^15.8.1",
"react":"18.0.0",
"react-i18next":"^11.18.3",
"react-native":"^0.70.1",
"react-native-autocomplete-dropdown":"^2.1.0",
"react-native-device-info":"^10.4.0",
"react-native-document-picker":"^8.1.3",
"react-native-file-viewer":"^2.1.5",
"react-native-flash-message":"^0.3.1",
"react-native-flipper":"^0.156.0",
"react-native-fs":"^2.20.0",
"react-native-gesture-handler":"^2.5.0",
"react-native-paper":"4.12.4",
"react-native-reanimated":"^2.9.1",
"react-native-responsive-screen":"^1.4.2",
"react-native-safe-area-context":"^4.3.1",
"react-native-screens":"^3.15.0",
"react-native-spinkit":"^1.5.1",
"react-native-splash-screen":"^3.3.0",
"react-native-switch":"^1.5.1",
"react-native-vector-icons":"^9.2.0",
"react-redux":"^8.0.2",
"redux-flipper":"^2.0.2",
"redux-persist":"^6.0.0"
},
I have tried changing gradle version and targetSdk and compileSdkversion
2
Answers
I’m using Mac M1 and below solution is works for me…!!!
Step : 1
Update buildToolsVersion to 34.0.0, minSdkVersion to 24,
targetSdkVersion to 34 in build.gradle(app module) file.
Step : 2
Update react-native-screens plugin to 3.32.0 and other plugin if
required.
Step : 3
Update build:gradle to 7.4.2. in build.gradle(app module) file. If
possible this is an update from Android Studio.
Step : 4
Add this method in MainApplication.java file.
Step : 5
Add below code in build.gradle(project module) file.
Step : 6
Clean project and then compile project.
Only change buildToolVersion and targetSdkVersion, it will pass