cordova / platforms / android / gradlew:命令失败,退出代码1错误输出:

时间:2016-09-10 21:39:39

标签: android cordova ionic-framework

我安装了cordova-onesignal-plugin会出现这种错误

在离子

中构建应用程序
sudo ionic build android

sudo cordova build android

错误:/ platforms / android / gradlew:命令失败,退出代码1错误输出: FAILURE:构建因异常而失败。

  • 出了什么问题: 配置根项目'android'时出现问题。

      

    无法解析配置':_debugCompile'的所有依赖项。   无法找到com.google.android.gms的任何匹配项:play-services-gcm:+因为没有com.google.android.gms版本:play-services-gcm可用。    在以下位置搜索:        repo1.maven.org/maven2/com/google/android/gms/play-services-gcm/maven-metadata.xml        repo1.maven.org/maven2/com/google/android/gms/play-services-gcm/        jcenter.bintray.com/com/google/android/gms/play-services-gcm/maven-metadata.xml        jcenter.bintray.com/com/google/android/gms/play-services-gcm/        文件:/usr/local/Cellar/android-sdk/24.4.1_1/extras/android/m2repository/com/google/android/gms/play-services-gcm/maven-metadata.xml        文件:/usr/local/Cellar/android-sdk/24.4.1_1/extras/android/m2repository/com/google/android/gms/play-services-gcm/    要求:        :安卓:不详   无法找到com.google.android.gms的任何匹配项:play-services-analytics:+因为没有com.google.android.gms版本:play-services-analytics可用。    在以下位置搜索:        repo1.maven.org/maven2/com/google/android/gms/play-services-analytics/maven-metadata.xml        repo1.maven.org/maven2/com/google/android/gms/play-services-analytics/        jcenter.bintray.com/com/google/android/gms/play-services-analytics/maven-metadata.xml        jcenter.bintray.com/com/google/android/gms/play-services-analytics/        文件:/usr/local/Cellar/android-sdk/24.4.1_1/extras/android/m2repository/com/google/android/gms/play-services-analytics/maven-metadata.xml        文件:/usr/local/Cellar/android-sdk/24.4.1_1/extras/android/m2repository/com/google/android/gms/play-services-analytics/    要求:        :安卓:不详   无法找到com.google.android.gms的任何匹配项:play-services-location:+因为没有com.google.android.gms版本:play-services-location可用。    在以下位置搜索:        repo1.maven.org/maven2/com/google/android/gms/play-services-location/maven-metadata.xml        repo1.maven.org/maven2/com/google/android/gms/play-services-location/        jcenter.bintray.com/com/google/android/gms/play-services-location/maven-metadata.xml        jcenter.bintray.com/com/google/android/gms/play-services-location/        文件:/usr/local/Cellar/android-sdk/24.4.1_1/extras/android/m2repository/com/google/android/gms/play-services-location/maven-metadata.xml        文件:/usr/local/Cellar/android-sdk/24.4.1_1/extras/android/m2repository/com/google/android/gms/play-services-location/    要求:        :机器人:未指定的

  • 尝试: 使用--stacktrace选项运行以获取堆栈跟踪。使用--info或--debug选项运行以获得更多日志输出。

1 个答案:

答案 0 :(得分:3)

尝试在偏好设置>下安装“Google Repository”外观&行为>系统设置> Android SDK> Android Studio中的SDK工具。为我工作。

Android Studio docs,您会看到:

  

Google Repository推荐。包括本地Maven存储库   Google图书馆,提供各种功能和服务   您的应用,例如Google登录,Google地图,游戏成就和   排行榜等等。

我敢打赌,这包括com.google.android.gms:play-services-gcm:+