title: How to solve Could not find method compile() for arguments [file collection]
body: <p>I imported a project into Android Studio, but the project is not getting built.
  the error message I get is:</p>
  
  <pre><code>Error:(20, 0) Could not find method compile() for arguments [file collection]  
  on object of type 
  org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler.
  
  &lt;a href="openFile:C:\Users\xxx\AndroidStudioProjects\WSAppAndroid 
  \build.gradle"&gt;Open File&lt;/a&gt;
  </code></pre>
  
  <p>As shown in image-1 posted below, in gradle.build (project) I have these libraries in the dependencies section.</p>
  
  <p>I googled how to solve this issue and among the posts I found was <a href="https://stackoverflow.com/questions/33991832/could-not-find-property-">this one</a> which tackles the same problem. But the accepted answer does not solve the problem i have.</p>
  
  <p>As an attempt to solve this issue, can I use <code>compile</code>  instead of <code>compile files</code> 
  in build.gradle? how it can be done?
  my question is </p>
  
  <p><strong>image-1</strong></p>
  
  <p><a href="https://i.stack.imgur.com/SMUyb.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/SMUyb.png" alt="enter image description here"></a></p>
  
  <p><strong>build.gradle (project)</strong>:</p>
  
  <pre><code>// 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'
  }
  </code></pre>
  
  <p>compile-on-org-gradle-api-internal-artifacts-dsl-depen/33991915#33991915</p>