I'm following the instructions for integrating Flurry Analytics using the official tutorial
I run into the problem that has been widely reported:
Error:(4, 0) Gradle DSL method not found: 'compile()' Possible causes:
The project 'My_Project' may be using a version of Gradle that does not contain the method. Open Gradle wrapper file The build file may be missing a Gradle plugin. Apply Gradle plugin
Here's the gradle file for the FlurryAnalytics-5.5.0 module autogenerated by Studio:
configurations.create("default")
artifacts.add("default", file('FlurryAnalytics-5.5.0.jar'))
dependencies {
compile files('FlurryAnalytics-5.5.0.jar')
}
I'm aware that a common solution prescribed in such questions as this one is to avoid putting the 'dependencies' closure in the top level build file. However, I don't have any non-gradle dependencies in that file, as is shown below.
build.gradle:
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:1.0.0'
}
}
allprojects {
repositories {
jcenter()
}
}
The
compile
option is a part of the Android Gradle Plugin.You need to apply that plugin to your module's build.gradle file if the module is an Android module.
With Jar:
or Maven Dependency: