java - Cant import project in Android studio(Could not find method compile() for arguments) -
sorry english. cant understand why cant import project android studio. have file build gradle
buildscript { repositories { jcenter() } dependencies { compile 'com.android.tools.build:gradle:2.2.2' classpath 'com.google.gms:google-services:1.5.0-beta2' // note: not place application dependencies here; belong // in individual module build.gradle files } } allprojects { repositories { maven { url "https://jitpack.io" } jcenter() } } task clean(type: delete) { delete rootproject.builddir }
but have error:
error:(9, 0) not find method compile() arguments [com.android.tools.build:gradle:2.2.2] on object of type org.gradle.api.internal.artifacts.dsl.dependencies.defaultdependencyhandler. open file
why mean?
you using wrong build.gradle file.
in top-level file can't define android block.
just move part inside module/build.gradle file.
Comments
Post a Comment