Here is how to automatically fix all android to androidx issues for React Native.
1. Please check that you have NPX installed and if not, install it with:
npm install -g npx
2. Add the following two flags to true in your gradle.properties file at ProjectFolder/android/gradle.properties
android.useAndroidX=true
android.enableJetifier=true
3. Execute these lines:
npm install --save-dev jetifier
npx jetify
npx react-native run-android
In your package.json add the following to scripts
"postinstall" : "npx jetify"
Thats it, you are set, for more info, please go to https://github.com/mikehardy/jetifier