Error:(8, 0) Gradle DSL method not found: compile() topic
I'm trying to reduce google play services' impact on APK size. I get the following error when i try to synchronize the gradle proyect. I would be very thankful if somebody can help me with this problem.
Error:(8, 0) Gradle DSL method not found: 'compile()'
Possible causes:
- The project 'MorphingTunnelFreeLauncher' may be using a version of Gradle that does not contain the method. Gradle settings
- The build file may be missing a Gradle plugin.
The changes in the gradle code looks like this:
- build.gradle in googleplayservices_lib
apply plugin: 'com.android.library'
android {
compileSdkVersion 9
buildToolsVersion "21.1.2"
defaultConfig {
minSdkVersion 9
targetSdkVersion 9
}
buildTypes {
release {
minifyEnabled true //changed
shrinkResources true //changed
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
}
}
}
dependencies {
compile files('libs/google-play-services.jar')
}
- build.gradle in the app itself:
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:1.1.0'
compile 'com.google.android.gms:play-services-ads:6.5.+'//changed
}
}
allprojects {
repositories {
jcenter()
}
}
Error:(8, 0) Gradle DSL method not found: 'compile()'
Possible causes:
- The project 'MorphingTunnelFreeLauncher' may be using a version of Gradle that does not contain the method. Gradle settings
- The build file may be missing a Gradle plugin.
The changes in the gradle code looks like this:
- build.gradle in googleplayservices_lib
apply plugin: 'com.android.library'
android {
compileSdkVersion 9
buildToolsVersion "21.1.2"
defaultConfig {
minSdkVersion 9
targetSdkVersion 9
}
buildTypes {
release {
minifyEnabled true //changed
shrinkResources true //changed
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
}
}
}
dependencies {
compile files('libs/google-play-services.jar')
}
- build.gradle in the app itself:
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:1.1.0'
compile 'com.google.android.gms:play-services-ads:6.5.+'//changed
}
}
allprojects {
repositories {
jcenter()
}
}
xda-developers
0 commentaires:
Enregistrer un commentaire