在Ionic 2项目上安装phonegap-plugin-push后出错

时间:2016-07-06 12:37:47

标签: android angular push-notification google-cloud-messaging ionic2

我正在使用Amazon SNS / GCM开发Ionic 2 / Angular 2项目。

我需要通过GCM发送和接收推送消息。

我使用此命令安装了push插件:

  

离子插件添加phonegap-plugin-push --variable   SENDER_ID = MY_GCM_SENDER_ID

现在,在Android模拟器上运行项目时出现以下错误:

FAILURE: Build failed with an exception.


* What went wrong:

Execution failed for task ':mergeDebugResources'.

>
C:\Users\My User\Documents\Projetos\my-project\app\platforms\android\build\intermediates\exploded-aar\com.google.android.gms\play-services-base\9.2.0\res\drawable-tvdpi-v4\common_google_signin_btn_text_light_disabled.9.png: Error: File path too long on Windows, keep below 240 characters : C:\Users\My Project\Documents\Projetos\my-project\app\platforms\android\build\intermediates\exploded-aar\com.google.android.gms\play-services-base\9.2.0\res\drawable-tvdpi-v4\common_google_signin_btn_text_light_disabled.9.png



* Try:

Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

 0=13, 1=10
 0=66, 1=85, 2=73, 3=76, 4=68, 5=32, 6=70, 7=65, 8=73, 9=76, 10=69, 11=68, 12=13, 13=10
 0=13, 1=10
 0=84, 1=111, 2=116, 3=97, 4=108, 5=32, 6=116, 7=105, 8=109, 9=101, 10=58, 11=32, 12=55, 13=46, 14=57, 15=51, 16=53, 17=32, 18=115, 19=101, 20=99, 21=115, 22=13, 23=10
Error: Error code 1 for command: cmd with args: /s,/c,""C:\Users\My User\Documents\Projetos\my-project\app\platforms\android\gradlew" cdvBuildDebug -b "C:\Users\My User\Documents\Projetos\my-project\app\platforms\android\build.gradle" -PcdvBuildArch=x86 -Dorg.gradle.daemon=true -Pandroid.useDeprecatedNdk=true"


Caught exception:
 undefined

Mind letting us know? https://github.com/driftyco/ionic-cli/issues

该应用程序也未在模拟器上运行。

如何使用push插件让我的项目正常运行?

1 个答案:

答案 0 :(得分:1)

解决!

<强>原因: 文件的路径

  

“C:\用户\我   项目\文件\ Projetos \我的项目\程序\平台\机器人\编译\ \中间体爆炸-AAR \ com.google.android.gms \播放服务基地\ 9.2.0 \水库\绘制-tvdpi-V4 \ common_google_signin_btn_text_light_disabled.9.png“

超过240个字符。

<强>解决方案: 从

移动项目
  

“C:\ Users \ My Project \ Documents \ Projetos \”

  

“C:\ Projetos \

更多详情Android Studio: “Execution failed for task ':app:mergeDebugResources'” if project is created on drive C:

不是一个重复的问题,而是具有相同原因的不同问题。