2017-11-15 29 views
1

私はインポートした後、このエラーにつまずいた次のようなエラーは、引数のメソッドのコンパイルを()が見つかりませんでした、org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler

Error:(17, 0) Could not find method compile() for arguments [file collection] on object of type org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler.

+0

説明を追加するか、ログインしてください.. @Agha –

答えて

0

を取得しています以前のバージョンのAndroid Studioで行われた以前のプロジェクト。 I.ビルドツールのバージョンを3.0.1以降にアップグレードし、testImplementation , androidTestImplementation, implementation IIという用語を認識させます。すべてimplementationに置き換えられるように、あなたのbuild.gradleアプリのファイルを編集しcompile

implementation fileTree(dir: 'libs', include: ['*.jar']) 
androidTestImplementation('com.android.support.test.espresso:espresso-core:2.2.2', { 
    exclude group: 'com.android.support', module: 'support-annotations' 
}) 
implementation 'com.android.support:appcompat-v7:27.0.2' 
testImplementation 'junit:junit:4.12' 
// RecyclerView 
implementation 'com.android.support:recyclerview-v7:27.0.2' 

はずです上記の溶液は、その後、その後、追加することによって固定されているAAPTに関するエラーが発生し

compile fileTree(dir: 'libs', include: ['*.jar']) 

androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', { 
    exclude group: 'com.android.support', module: 'support-annotations' 
}) 
compile 'com.android.support:appcompat-v7:27.0.2' 
testImplementation 'junit:junit:4.12' 

// RecyclerView 
compile 'com.android.support:recyclerview-v7:27.0.2' 

読みますgradle.propertiesファイルの下の行

android.enableAapt2=false 

これは流行であるか、毎回動作するかどうかわかりません

関連する問題