Thursday, June 23, 2016

[Android][Resolved] Could not find method complie() for arguments [com.google.android.gms:play-services:8.1.0]

Full error message:
Error:(9, 1) A problem occurred evaluating root project 'MyAndroidTutorial'.
> Could not find method complie() for arguments [com.google.android.gms:play-services:8.1.0] on org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler_Decorated@429c3aa0.

Source : /build.gradle
// 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.5.0'
        complie 'com.google.android.gms:play-services:8.1.0' 
        compile "com.android.support:appcompat-v7:22.1.0" 
 
        // NOTE: Do not place your application dependencies here; they belong 
        // in the individual module build.gradle files     
    }
}
allprojects { 
    repositories { 
        jcenter() 
    }
}
task clean(type: Delete) { 
    delete rootProject.buildDir
}
These are two problem, 
  1. Be ware not to place the application dependencies (compile 'com.google.android.gms:play-services:9.0.1'compile "com.android.support:appcompat-v7:22.1.0") at file named "build.gradle" which's located at project root. You should add that in "build.gradle" in your module, for example, /app/build.gradle.
  2. Error is caused by a stupid careless mistake: be ware it should be "compile" but not complie. That's mean this sentence should be corrected :
compile 'com.google.android.gms:play-services:8.1.0' 
compile "com.android.support:appcompat-v7:22.1.0"

Reference:

http://stackoverflow.com/questions/31539610/could-not-find-method-complie-for-arguments-com-google-android-gmsplay-servi

No comments :

Post a Comment