2015-10-20 51 views
0

我在android開發新。我想設置我的應用程序接收位置更新,所以我一步一步通過谷歌發展教程。我在清單文件等創建權限等...但我有一個與Gradle文件的問題。在谷歌教程中,我讀,我需要放編譯設置谷歌播放服務的gradle文件

'com.google.android.gms:play-services:8.1.18' 

我的Gradle模塊文件,所以我已經做了,但不能同步gradle這個項目,它給我的錯誤:

Error(25, 0) gradle DSL method not found: 'compile()' The project 'name' may be using wrong version of Gradle that does not contain a method. The build file may be missing a Gradle plugin. 

這是我的Gradle模塊文件:

apply plugin: 'com.android.application' 

android { 
compileSdkVersion 23 
buildToolsVersion "23.0.1" 

defaultConfig { 
applicationId "com.example.filip.whereismydevice" 
minSdkVersion 19 
targetSdkVersion 23 
versionCode 1 
versionName "1.0" 
} 
buildTypes { 
release { 
    minifyEnabled false 
    proguardFiles getDefaultProguardFile('proguard-android.txt'),      'proguard-rules.pro' 
} 
} 
} 

dependencies { 
compile fileTree(dir: 'libs', include: ['*.jar']) 
compile 'com.android.support:appcompat-v7:23.0.1' 
complie 'com.google.android.gms:play-services:8.1.18' 
} 

,這是我的項目,主要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.3.0' 

// NOTE: Do not place your application dependencies here; they belong 
// in the individual module build.gradle files 
} 
} 

allprojects { 
repositories { 
jcenter() 
} 
} 

所以,我不知道什麼可能是錯誤的,我正在尋找互聯網上的解決方案,但沒有找到相同的錯誤。如果已經解決了這個問題。

回答

0
complie 'com.google.android.gms:play-services:8.1.18' 

應該

compile 'com.google.android.gms:play-services:8.1.0' 

注:

  • 你拼錯編譯
  • Google Play服務的最新版本是8.1.0
+0

該死的我延緩......真的只是拼錯字xD無論如何謝謝你:D –

+0

不用擔心。我們都會犯錯... – jomartigcal

0

你從哪裏找到google play服務版本?到目前爲止,最新的版本是8.1.0所以改變你符合

complie 'com.google.android.gms:play-services:8.1.0'