1

I'm developing an Ionic 2/Angular 2 project using Amazon SNS/GCM.

I need to send and receive push messages via GCM.

I installed the push plugin using this command:

ionic plugin add phonegap-plugin-push --variable SENDER_ID=MY_GCM_SENDER_ID

Now I get the following error when running my project on the Android emulator:

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

Also the app is not running on the emulator.

How could I make my project to run properly using push plugin?

Natanael
  • 1,326
  • 5
  • 17
  • 34

1 Answers1

1

Solved!

Cause: The path for the file

"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"

has more than 240 characters.

Solution: Move the project from

"C:\Users\My Project\Documents\Projetos\"

to

"C:\Projetos\

More details: Android Studio: “Execution failed for task ':app:mergeDebugResources'” if project is created on drive C:

Not a duplicated question, but different questions with the same cause.

Community
  • 1
  • 1
Natanael
  • 1,326
  • 5
  • 17
  • 34