react-native-image-picker: Could not find com.android.tools:common:25.2.3
Description
I tried to build my react-native application for android. AndroidStudio tell me that common:25.2.3 is undefined in jcenter repository. My build.gradle is configured to use 3.1.4 gradle version.
How to repeat issue and example
Create a new react application (version should be 0.57.7).
Install and link react-native-image-picker.
Open AndroidStudio, ask it to sync project file with gradle files.
Solution
I edited build.gradle to update 2+ to 3.1.4 and added google in repositories.
Additional Information
- React Native version: 0.57.7
- Platform: Android
- Development Operating System: MacOS
- Dev tools: Android Studio v3.2.1
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Reactions: 1
- Comments: 16
For those that do not use local builds you can edit your app’s build.gradle (not app/build.gradle) to include:
This will override the current configuration for you. This is for those that can not modify the projects gradle during the build process.
Yes, try to edit
node_modules/react-native-image-picker/android/build.gradleand replace buildscript with:You should edit
classpath 'com.android.tools.build:gradle:3.1.4'according to your main build.gradle (mine is configured to use v3.1.4):having exact same issue but I don’t feel like editing files in node_modules to get this to work
WHAT IS GOING ON???
@KalebMatthews you save my life! I spent three days looking for it, I don’t know if it is a final solution, but it works!
Is this the same problem you are having? Here’s mine.
A problem occurred configuring project ‘:react-native-image-picker’.