Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

React Native Gradle ImagePicker wont build

When trying to build I get this error:

Could not find any matches for com.android.tools.build:gradle:2.2.+ as no versions of com.android.tools.build:gradle are available. Searched in the following locations: https://jcenter.bintray.com/com/android/tools/build/gradle/maven-metadata.xml https://jcenter.bintray.com/com/android/tools/build/gradle/ Required by: project :react-native-image-picker

However when I change the tools version in the Project gradle.build to 2.2.3 I get this error:

Could not find method implementation() for arguments [directory 'libs'] on object of type org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler.

like image 428
georgcon Avatar asked Dec 10 '18 17:12

georgcon


1 Answers

Edit your build.gradle as following.

subprojects { subproject ->
    if (subproject.name.contains('react-native-image-picker')){
        buildscript {
            repositories {
                maven { url "https://dl.bintray.com/android/android-tools/"  }
            }
        }
    }
}
like image 153
Author Avatar answered Oct 01 '22 12:10

Author