2016-05-28 5 views
2

私はAndroidスタジオ2.1.1を使用しています。 http://www.androidhive.info/2016/05/android-working-with-card-view-and-recycler-view/「My Application」プロジェクトは、メソッドが含まれていないバージョンのGradleを使用している可能性があります。

これはファイルbuild.gradleです:私はこのチュートリアルに従う

// Top-level build file where you can add configuration options common to all sub-projects/modules. 

buildscript { 
    repositories { 
     jcenter() 
    } 
    dependencies { 
     classpath 'com.android.tools.build:gradle:2.1.0' 
     compile 'com.android.support:cardview-v7:23.3.+' 

     // NOTE: Do not place your application dependencies here; they belong 
     // in the individual module build.gradle files 
    } 
} 

allprojects { 
    repositories { 
     jcenter() 
    } 
} 

task clean(type: Delete) { 
    delete rootProject.buildDir 
} 

その後のAndroidスタジオ予告:

プロジェクト 'マイアプリケーション' がないことのGradleのバージョンを使用することができます方法が含まれています

enter image description here

プロジェクトをビルドできません。私は問題を解決するのに役立ちます。プロジェクトレベルbuild.gradleファイルから

compile 'com.android.support:cardview-v7:23.3.+' 

し、アプリケーションレベルbuild.gradleファイルに貼り付けます。

+0

ポストモジュール 'ここbuild.gradle'ファイル:

アプリケーションレベルbuild.gradleファイルは次のようになります。 – Ironman

答えて

3

は、この行を削除します。

apply plugin: 'com.android.application' 

android { 
//... 
} 

dependencies { 
compile 'com.android.support:cardview-v7:23.3.0' 
compile 'com.android.support:recyclerview-v7:23.3.0' 
//... 
} 
関連する問題