The app I builded last year with RN supports 17000 devices, Android 5 or +, the app I builded this year supports only 400 devices and asking for Android 11. Its a big issue because even a modern phone (like a Oneplus 7t on Android 11) cant install it. Is it because of the new architecture ?
My build.gradle says minSdkVersion 21 but in the store the Api Level is 30+, here is my build.gradle :
buildToolsVersion = findProperty('android.buildToolsVersion') ?: "31.0.0"
minSdkVersion = 21
compileSdkVersion = Integer.parseInt(findProperty('android.compileSdkVersion') ?: "31")
targetSdkVersion = Integer.parseInt(findProperty('android.targetSdkVersion') ?: "30")
if (hasProperty('android.kotlinVersion')) {
kotlinVersion = findProperty('android.kotlinVersion')
}
if (System.properties['os.arch'] == "aarch64") {
// For M1 Users we need to use the NDK 24 which added support for aarch64
ndkVersion = "24.0.8215888"
} else if (Os.isFamily(Os.FAMILY_WINDOWS)) {
// For Android Users, we need to use NDK 23, otherwise the build will
// fail due to paths longer than the OS limit
ndkVersion = "23.1.7779620"
} else {
// Otherwise we default to the side-by-side NDK version from AGP.
ndkVersion = "21.4.7075529"
}
When I try to build with a compiledSdkVersion of 30 I get three errors like that one :
The minCompileSdk (31) specified in a
[RUN_GRADLEW] dependency's AAR metadata (META-INF/com/android/build/gradle/aar-metadata.properties)
[RUN_GRADLEW] is greater than this module's compileSdkVersion (android-30).
[RUN_GRADLEW] Dependency: androidx.room:room-runtime:2.4.2.
[RUN_GRADLEW] AAR metadata file: /Users/****/.gradle/caches/transforms-3/9ac05f15070298b4a18a70593d977e32/transformed/room-runtime-2.4.2/META-INF/com/android/build/gradle/aar-metadata.properties.
package.json :
"dependencies": {
"@react-native-async-storage/async-storage": "~1.17.3",
"@react-native-firebase/analytics": "^14.10.1",
"@react-native-firebase/app": "^14.10.1",
"@react-navigation/material-top-tabs": "^6.2.1",
"@react-navigation/native": "^6.0.10",
"@react-navigation/native-stack": "^6.6.2",
"axios": "^0.27.2",
"expo": "^45.0.0",
"expo-apple-authentication": "~4.2.1",
"expo-auth-session": "~3.6.0",
"expo-av": "~11.2.3",
"expo-crypto": "~10.2.0",
"expo-image-picker": "~13.1.1",
"expo-random": "~12.2.0",
"expo-splash-screen": "~0.15.1",
"expo-status-bar": "~1.3.0",
"expo-updates": "~0.13.1",
"expo-web-browser": "~10.2.0",
"intl": "^1.2.5",
"obfuscator-io-metro-plugin": "^2.0.0",
"react": "17.0.2",
"react-dom": "17.0.2",
"react-native": "0.68.2",
"react-native-animatable": "^1.3.3",
"react-native-htmlview": "^0.16.0",
"react-native-image-zoom-viewer": "^3.0.1",
"react-native-modal": "^13.0.1",
"react-native-pager-view": "^5.4.15",
"react-native-paper": "^4.12.1",
"react-native-safe-area-context": "4.2.4",
"react-native-screens": "~3.11.1",
"react-native-select-dropdown": "^1.13.0",
"react-native-tab-view": "^3.1.1",
"react-native-toast-notifications": "^3.2.3",
"react-native-web": "0.17.7",
"react-native-webview": "^11.18.2",
"react-native-youtube-iframe": "^2.2.2",
"react-redux": "^8.0.1",
"redux": "^4.2.0",
"redux-persist": "^6.0.0",
"redux-thunk": "^2.4.1"
},
What should I do ? Should I downgrade RN ?