I have been trying to integrate react-native-image-picker
in my React Native Android app, but I am facing issues after following the setup instructions. The app doesn’t load the image picker correctly,
after i run :
cd android
./gradlew clean
cd ..
npx react-native run-androidpe here
i get that error :
Task :react-native-image-picker:compileDebugJavaWithJavac FAILED
Deprecated Gradle features were used in this build, making it incompatible with Gradle 9.0.
Image for error i get :
Below are the steps I’ve followed and things I have tried.
Steps I Followed:
-
Installed
react-native-image-picker
:npm install react-native-image-picker
-
Linked the library manually in
MainApplication.java
:-
I ensured to manually add the
ImagePickerPackage
inside thegetPackages()
method:import com.imagepicker.ImagePickerPackage; @Override protected List<ReactPackage> getPackages() { List<ReactPackage> packages = new PackageList(this).getPackages(); packages.add(new ImagePickerPackage()); return packages; }
-
-
Updated
react-native-image-picker
to the latest version:
I ran:npm install react-native-image-picker@latest
Any assistance would be greatly appreciated! Is there something specific I might be missing? can you help me troubleshoot the steps in my configuration? Thank you in advance!
Abdelghafour Lahnida is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
1
You can removed the ^ to retain the at 7.1.2 version.
React Native: ^0.72.15
React: 18.2.0
Mayank Pambhar is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.