离子android构建失败,异常

时间:2015-10-31 13:31:22

标签: android cordova push-notification google-cloud-messaging ionic

尝试使用离子来构建我的第一个应用程序。 我添加了phonegap-plugin-push可能会出现问题,而且无法解决问题。尝试更新android SDK,安装并重新安装。项目仅使用离子启动appName

启动

启动项目时我没有提到任何包标识符。我刚刚做了离子平台添加android来添加android到项目。

在运行ionic build android时粘贴下面的日志。

FAILURE: Build failed with an exception.
* 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-services-gcm:+.
 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/
     file:/Users/Yashwanth/NVPACK/android-sdk-macosx/extras/android/m2repository/com/google/android/gms/play-services-gcm/maven-metadata.xml
     file:/Users/Yashwanth/NVPACK/android-sdk-macosx/extras/android/m2repository/com/google/android/gms/play-services-gcm/
 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.

BUILD FAILED

Total time: 3.125 secs

    /Users/Yashwanth/appName/platforms/android/cordova/node_modules/q/q.js:126
                throw e;
                ^
Error code 1 for command: /Users/Yashwanth/appName/platforms/android/gradlew with args: cdvBuildDebug,-b,/Users/Yashwanth/appName/platforms/android/build.gradle,-Dorg.gradle.daemon=true
ERROR building one of the platforms: Error: /Users/Yashwanth/appName/platforms/android/cordova/build: Command failed with exit code 1
You may not have the required environment or OS to build this project
Error: /Users/Yashwanth/appName/platforms/android/cordova/build: Command failed with exit code 1
at ChildProcess.whenDone (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/cordova/superspawn.js:139:23)
at emitTwo (events.js:87:13)
at ChildProcess.emit (events.js:172:7)
at maybeClose (internal/child_process.js:817:16)
at Process.ChildProcess._handle.onexit (internal/child_process.js:211:5)

问题似乎与配置推送有关。请帮我解决一下。

1 个答案:

答案 0 :(得分:3)

在Android SDK管理器上添加Google Repository修复了它。