0
votes

I am developing Android and iOS app using Ionic framework (Web technologies) and I want to add Push Notifications with the help of the new Firebase feature, FCM.

But I'm facing this issue while deploying on a device:

Severity Code Description Project File Line Suppression State Error Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. ionic-js-sidemenu1 1
Error FAILURE: Build failed with an exception. ionic-js-sidemenu1 1
Error * What went wrong: ionic-js-sidemenu1 1
Error A problem occurred configuring root project 'android'. ionic-js-sidemenu1 1
Error > Could not resolve all dependencies for configuration ':_debugCompile'. ionic-js-sidemenu1 1
Error > Could not find com.google.firebase:firebase-core:9.2.0. ionic-js-sidemenu1 1
Error Searched in the following locations: ionic-js-sidemenu1 1
Error https://repo1.maven.org/maven2/com/google/firebase/firebase-core/9.2.0/firebase-core-9.2.0.pom ionic-js-sidemenu1 1
Error https://repo1.maven.org/maven2/com/google/firebase/firebase-core/9.2.0/firebase-core-9.2.0.jar ionic-js-sidemenu1 1
Error https://jcenter.bintray.com/com/google/firebase/firebase-core/9.2.0/firebase-core-9.2.0.pom ionic-js-sidemenu1 1
Error https://jcenter.bintray.com/com/google/firebase/firebase-core/9.2.0/firebase-core-9.2.0.jar ionic-js-sidemenu1 1
Error file:/C:/Users/Hassan/.m2/repository/com/google/firebase/firebase-core/9.2.0/firebase-core-9.2.0.pom ionic-js-sidemenu1 1
Error file:/C:/Users/Hassan/.m2/repository/com/google/firebase/firebase-core/9.2.0/firebase-core-9.2.0.jar ionic-js-sidemenu1 1
Error Required by: ionic-js-sidemenu1 1
Error :android:unspecified ionic-js-sidemenu1 1
Error > Could not find com.google.firebase:firebase-messaging:9.2.0. ionic-js-sidemenu1 1
Error Searched in the following locations: ionic-js-sidemenu1 1
Error https://repo1.maven.org/maven2/com/google/firebase/firebase-messaging/9.2.0/firebase-messaging-9.2.0.pom ionic-js-sidemenu1 1
Error https://repo1.maven.org/maven2/com/google/firebase/firebase-messaging/9.2.0/firebase-messaging-9.2.0.jar ionic-js-sidemenu1 1
Error https://jcenter.bintray.com/com/google/firebase/firebase-messaging/9.2.0/firebase-messaging-9.2.0.pom ionic-js-sidemenu1 1
Error https://jcenter.bintray.com/com/google/firebase/firebase-messaging/9.2.0/firebase-messaging-9.2.0.jar ionic-js-sidemenu1 1
Error file:/C:/Users/Hassan/.m2/repository/com/google/firebase/firebase-messaging/9.2.0/firebase-messaging-9.2.0.pom ionic-js-sidemenu1 1
Error file:/C:/Users/Hassan/.m2/repository/com/google/firebase/firebase-messaging/9.2.0/firebase-messaging-9.2.0.jar ionic-js-sidemenu1 1
Error Required by: ionic-js-sidemenu1 1
Error :android:unspecified ionic-js-sidemenu1 1
Error * Try: ionic-js-sidemenu1 1
Error Error code 1 for command: cmd with args: /s,/c,""D:\My Work\Ionic\ionic-js-sidemenu1\ionic-js-sidemenu1\platforms\android\gradlew" cdvBuildDebug -b "D:\My Work\Ionic\ionic-js-sidemenu1\ionic-js-sidemenu1\platforms\android\build.gradle" -Dorg.gradle.daemon=true -Pandroid.useDeprecatedNdk=true" ionic-js-sidemenu1

All you need is to add this 3 plugin

⁠⁠⁠ionic plugin add cordova-plugin-inappbrowser
ionic plugin add cordova-plugin-fcm
ionic plugin add cordova-plugin-velda-devicefeedback
1
did you get your google-services.json?JC Borlagdan
yes add into platform>android > directoryHassan Abbas
and you tried to build the apk into the phone, and send notification from the firebase console?JC Borlagdan
when i tried to build on phone, above error stop the buildHassan Abbas
@JCBorlagdan can you provide me some demoHassan Abbas

1 Answers

2
votes

I get this error now, this is not in your FCM or other plugins.

It's just your version of google play services.

Open your Android SDK Manager
Update both Google Play Services rev 30 and
Google Repository rev 26.

Try building again.