android - Error:(6, 0) Gradle DSL method not found: 'google()' -


/users/ren/desktop/recylerviewbaseadapter/build.gradle error:(6, 0) gradle dsl method not found: 'google()' possible causes: project 'recylerviewbaseadapter' may using version of gradle not contain method. gradle settings build file may missing gradle plugin. apply gradle plugin 

the google() repo shortcut looks in google's maven repository dependencies. introduced gradle v.4.0.

it requires (currently)

  • gradle v.4
  • android studio 3.x.
  • gradle plugin android 3.x

try use in gradle-wrapper.properties use:

distributionurl=\   https\://services.gradle.org/distributions/gradle-4.1-rc-1-all.zip 

as gradle plugin android use:

classpath 'com.android.tools.build:gradle:3.0.0-beta1' 

in case (also android studio 2.3, gradle plugin 2.3.3 , gradle v3.3) can use same maven repo using { url 'https://maven.google.com'}. same.

just use example:

buildscript {     repositories {         maven {             url 'https://maven.google.com'         }         jcenter()         maven { url 'https://maven.fabric.io/public' }     }  // } 

Comments

Popular posts from this blog

python - Operations inside variables -

Generic Map Parameter java -

arrays - What causes a java.lang.ArrayIndexOutOfBoundsException and how do I prevent it? -