0
Configure project :react-native-exit-app
WARNING: Configuration 'compile' is obsolete and has been replaced with 'implementation' and 'api'.
It will be removed at the end of 2018. For more information see: http://d.android.com/r/tools/update-dependency-configurations.html

FAILURE: Build failed with an exception.

• What went wrong: A problem occurred configuring project ':react-native-image-picker'.

Could not resolve all artifacts for configuration ':react-native-image-picker:classpath'.

Could not find any version that matches com.android.tools.build:gradle:2.2.+.

Versions that do not match:
2.3.0
2.1.3
2.1.2
2.1.0
2.0.0
+ 71 more
Searched in the following locations: https://jcenter.bintray.com/com/android/tools/build/gradle/maven-metadata.xml
Required by: project :react-native-image-picker

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 7s

I expect if someone facing the same situation of me and

1 Answer 1

0

What version of react-native-image-picker are you trying to install?

My guess is that you are trying to run either an old React Native project or an old version of the library, or both (because of the 'compile' replacement warning).

In that case I think you might have problems with downloading those build tools on Android because of jcenter repository being deprecated and down since 2022.

If you do not want to update the project and libraries (which I recommend, because you might get stuck on similar problems on the way after fixing this one), try to add this to your root gradle file in android directory (not in app/gradle) inside of subprojects clause:

subprojects {
    if (project.name.contains('react-native-image-picker') || 
        project.name.contains('react-native-vector-icons')) {
        buildscript {
            repositories {
                mavenCentral()
            }
        }
    }
}

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.