I imported a project into Android Studio, but the project is not getting built. the error message I get is:
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>
As shown in image-1 posted below, in gradle.build (project) I have these libraries in the dependencies section.
I googled how to solve this issue and among the posts I found was this one which tackles the same problem. But the accepted answer does not solve the problem i have.
As an attempt to solve this issue, can I use compile
instead of compile files
in build.gradle? how it can be done?
my question is
image-1
build.gradle (project):
// 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'
}
compile-on-org-gradle-api-internal-artifacts-dsl-depen/33991915#33991915