2017-06-27 3 views
0

私は、Android Studioにプロジェクトをインポートしますが、プロジェクトが組み込まれて取得されていません。私が手 エラーメッセージは次のとおりです。どのように解決する方法のコンパイルを見つけることができませんでした()の引数のための[ファイルコレクション]

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

<a href="openFile:C:\Users\xxx\AndroidStudioProjects\WSAppAndroid 
\build.gradle">Open File</a> 

gradle.build(プロジェクト)に、下記掲載画像-1に示したように、私は依存関係のセクションでこれらのライブラリを持っています。

私は、この問題を解決する方法をGoogleで検索し、私が見つけた記事の中で、同じ問題に取り組んでいるthis oneました。しかし、受け入れられた答えは私が持っている問題を解決しません。

この問題を解決するための試みとして、012. の代わりにcompileをbuild.gradleに使用できますか?どのようにそれを行うことができますか? 私の質問は

画像-1

enter image description here

build.gradle(プロジェクト)

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

buildscript { 
repositories { 
    jcenter() 
    mavenCentral() 
} 
dependencies { 
    classpath 'com.android.tools.build:gradle:2.3.0' 
    classpath 'com.neenbedankt.gradle.plugins:android-apt:1.7' // 1.8? 
} 
} 
allprojects { 
repositories { 
    jcenter() 
    mavenCentral() 
} 
} 

dependencies { 
compile files('gradle/wrapper/gradle-wrapper.jar') 
compile files('app/libs/android-viewbadger.jar') 
compile files('app/libs/iDappsImagesLib_v0.2.jar') 
compile files('app/libs/iDappsToolsLib_v0.1.jar') 
compile 'com.android.support:support-v4:25.2.0' 
} 

コンパイル・オン・ORG-のGradle-API-側内蔵アーティファクト-DSL-depen/33991915#33991915

+0

はどこイメージであるのだろうか? –

+0

あなたのbuild.gradleを共有します – LazerBanana

+0

'プラグインを適用しました: 'java'' – LazerBanana

答えて

0

依存関係としてローカルjarを追加したい場合は、私は示唆しています。

追加apply plugin: 'java'

その後、リポジトリ

repositories { 
    flatDir { 
     dirs 'libs' 
    } 
} 

としてフォルダを追加する依存関係に追加します。

dependencies { 
    compile name: 'whatever' 
} 

もう1つの理由は、Gradleラッパーを依存関係として追加しますか?

0

このプロジェクトではローカルライブラリを使用しているため、compile fileTree(include: ['*.jar'], dir: 'libs')を追加する必要があります。jarslibsというフォルダにインポートします。

ので、あなたは

dependencies { 
compile fileTree(include: ['*.jar'], dir: 'libs') 
compile files('gradle/wrapper/gradle-wrapper.jar') 
compile files('app/libs/android-viewbadger.jar') 
compile files('app/libs/iDappsImagesLib_v0.2.jar') 
compile files('app/libs/iDappsToolsLib_v0.1.jar') 
compile 'com.android.support:support-v4:25.2.0' 
} 
+0

のプロジェクトfoldeersが含まれています: – LetsamrIt

+0

を取得します –

関連する問題