React Native Gradle ImagePicker wont build

  • A+
Category:Languages

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.

 


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/"  }             }         }     } } 

Comment

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen: