recyclerview - Could not found method compile() in gradle Android Studio -
i'm new android studio , android development , developing first application.
i want use carview
, recyclerview
display data. according many tutorials on it, need add following dependencies
compile 'com.android.support:cardview-v7:21.0.+' compile 'com.android.support:recyclerview-v7:21.0.+'
this how build.gradle
is
// top-level build file can add configuration options common sub-projects/modules. buildscript { repositories { jcenter() } dependencies { classpath 'com.android.tools.build:gradle:2.2.2' // note: not place application dependencies here; belong // in individual module build.gradle files } } allprojects { repositories { jcenter() } } task clean(type: delete) { delete rootproject.builddir } dependencies { compile 'com.android.support:cardview-v7:21.0.+' compile 'com.android.support:recyclerview-v7:21.0.+' }
but on sync gradle, gives error as
error:could not find method compile() arguments [com.android.support:cardview-v7:21.0.+] on object of type org.gradle.api.internal.artifacts.dsl.dependencies.defaultdependencyhandler. please install android support repository android sdk manager.
i tried many solutions google search couldn't found working.
android studio creates project 2 build.gradle files.
this section of code
dependencies { compile 'com.android.support:cardview-v7:21.0.+' compile 'com.android.support:recyclerview-v7:21.0.+' }
goes app/build.gradle
of project. want update 21 version number sdk you're compiling with.
after that, have install android support repository android sdk manager.
Comments
Post a Comment