Build error if i use ionic start <name> push starter template


#1

I am using the starter template for ionic push notifications. I started with this tutorial https://www.airpair.com/javascript/posts/push-it-real-good-with-ionic
I created a starter template using ionic start ionicpush push

When i run the command ionic build android with making any changes in the app, i am getting the following errors. I am unable to build for android, but i am able to build for iOS.



Running command: /Users/rajeshwar/workspace/others/ionicpush/hooks/after_prepare/010_add_platform_class.js /Users/rajeshwar/workspace/others/ionicpush
add to body class: platform-android
Running command: /Users/rajeshwar/workspace/others/ionicpush/platforms/android/cordova/build
ANDROID_HOME=/usr/local/opt/android-sdk
JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.7.0_79.jdk/Contents/Home
Running: /Users/rajeshwar/workspace/others/ionicpush/platforms/android/gradlew cdvBuildDebug -b /Users/rajeshwar/workspace/others/ionicpush/platforms/android/build.gradle -Dorg.gradle.daemon=true

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.android.support:support-v4:+.
Searched in the following locations:
https://repo1.maven.org/maven2/com/android/support/support-v4/maven-metadata.xml
https://repo1.maven.org/maven2/com/android/support/support-v4/
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: 9.408 secs

Does any one has a solution for this?


#2

See this issue https://github.com/driftyco/ionic-service-push-client/issues/22

You need to install the Android Support Library or updating it AND installing Android Support Repository