2016-11-17 109 views
0

我正在使用FCM在構建apk構建錯誤came.please幫助我解決此問題時使用FCM離子推送通知。Android構建錯誤

錯誤:cmd:命令失敗,退出代碼爲1錯誤輸出: 失敗:生成失敗並出現異常。

* What went wrong: 
A problem occurred configuring root project 'android'. 
> Could not resolve all dependencies for configuration ':_debugCompile'. 
    > Could not find any version that matches com.google.android.gms:play-service 
s-gcm:9.8+. 
    Versions that do not match: 
     9.4.0 
     9.2.1 
     9.2.0 
     9.0.2 
     9.0.1 
     + 5 more 
    Searched in the following locations: 
     https://repo1.maven.org/maven2/com/google/android/gms/play-services-gcm 
/maven-metadata.xml 
     https://repo1.maven.org/maven2/com/google/android/gms/play-services-gcm 
/
     https://jcenter.bintray.com/com/google/android/gms/play-services-gcm/ma 
ven-metadata.xml 
     https://jcenter.bintray.com/com/google/android/gms/play-services-gcm/ 
     file:/C:/Users/veeravel.p/android-sdks/extras/android/m2repository/com/ 
google/android/gms/play-services-gcm/maven-metadata.xml 
     file:/C:/Users/veeravel.p/android-sdks/extras/android/m2repository/com/ 
google/android/gms/play-services-gcm/ 
     file:/C:/Users/veeravel.p/android-sdks/extras/google/m2repository/com/g 
oogle/android/gms/play-services-gcm/maven-metadata.xml 
    Required by: 
     :android:unspecified 

* Try: 
Run with --stacktrace option to get the stack trace. Run with --info or --debug 
option to get more log output. 
+0

您可以加入您的build.gradle嗎? – N0un

+0

確保您在頂級構建文件'dependencies'中使用'classpath'com.google.gms:google-services:3.0.0'' – N0un

回答

0

你必須補充一點,在頂層構建文件:

dependencies { 
    ... 
    classpath 'com.google.gms:google-services:3.0.0' 
    ... 
}