【发布时间】:2015-10-31 13:31:21
【问题描述】:
尝试使用 ionic 构建我的第一个应用程序。 我添加了 phonegap-plugin-push 可能是这里出了点问题,无法弄清楚。尝试更新android SDK,安装并重新安装。项目仅使用 ionic start appName 启动
我在启动项目时没有提及任何包标识符。我刚刚做了 ionic platform add 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)
问题似乎与配置推送有关。请帮我解决一下。
【问题讨论】:
-
您可以尝试安装最新版本的 Android Support Repository、Android Support Library、Google Play Services 和 Google Repository 在 Android SDK 管理器中。
标签: android cordova push-notification google-cloud-messaging ionic