I migrated my app to AndroidX and it\'s crashing on launch on API level 21. My application throws this exception:
10-08
The problem is your React Native android project is not in AndroidX while react-native-image-picker
is in an AndroidX environment; therefore, it is missing packages from the androidx package library.
Simple fix is adding the following lines to your ./android/gradle.properties
file:
android.useAndroidX=true
android.enableJetifier=true
If you have any existing RN libraries that uses old android packages, your project won't build since they will be missing once you updated your project.
A clever tool found here deals with RN libraries that uses old android packages and brings them up to date.
npm i --save-dev jetifier
npx jetify
react-native run-android
All checked out and it's working on my end. Hope this helps anyone and please do share if it does.
Source https://github.com/react-native-community/react-native-image-picker/issues/1088#issuecomment-509755692