Android Error Dependencies Firebase Cloud Messaging


#1

I’m getting this error after trying to install Push Notifications with Firebase Cloud Messaging in Ionic 3. I haven’t downloaded the cordova FCM plugin because according to a tutorial I watched, it shouldn’t be necessary.

A problem occurred configuring root project ‘android’.

Could not resolve all dependencies for configuration ':_debugApkCopy'. Could not find com.google.firebase:firebase-messaging:11.0.1. Required by: project : Could not find com.google.firebase:firebase-core:11.0.1. Required by: project :

I have tried all the steps in https://firebase.google.com/docs/android/setup and have updated Google Repistory and services as seen here: ![Latest Android Stuff Installed]http://i.imgur.com/vo1GcHP.png

Build.gradle



    apply plugin: 'com.android.application'

buildscript {
    repositories {
        mavenCentral()
        jcenter()
    }

    dependencies {
        classpath 'com.android.tools.build:gradle:2.2.3'
        classpath 'com.google.gms:google-services:3.1.0'
    }
}........
    dependencies {
    compile fileTree(dir: 'libs', include: '*.jar')
    // SUB-PROJECT DEPENDENCIES START
    debugCompile(project(path: "CordovaLib", configuration: "debug"))
    releaseCompile(project(path: "CordovaLib", configuration: "release"))
    compile "com.android.support:support-v13:25.1.0"
    compile "me.leolin:ShortcutBadger:1.1.17@aar"
    compile "com.google.firebase:firebase-messaging:11.0.1"
    // SUB-PROJECT DEPENDENCIES END
}.......
    if (hasProperty('postBuildExtras')) {
    postBuildExtras()
}
apply plugin: 'com.google.gms.google-services'

I was thinking that this error could possibly be due to the version of Firebase installed versus what the project requires. According to the website, the version 11.2.0 is out whereas my project requires 11.0.1. Similarly, I don’t know which version of google-services I should be declaring in my build.gradle file. Please help!


#2

I am getting exact same error. Using Ionic 3 with firebase cloud messaging. Tried everything with dependancies , android sdk updates and all. Could not figure out the solution. Please do share if you find any solution.


#3

I’m having same issue, exactly the same. UP the topic :slight_smile:

EDIT: Obviously any change i do in the build.gradle it’s not working because ionic cordova build android override that file.


#4

@HectorDev @ashishprabhakar Any of you who know how to post a github issue? Perhaps we can get it fixed in a patch.


#5

Same issue here. And i’m literally running mad


#6

I have same issue. Any solution?


#7

@ingeday @laxusgee Seems like this is a widespread bug in Ionic. Submit a GitHub issue if you can


#8

@ingeday @laxusgee @HectorDev @ashishprabhakar Hello my friends. I have now solved this problem. For me, it was as simple as reconfiguring the environment variables in Windows. My android_Home variable pointed to E:/AndroidSdk where I had installed it, instead of C:/Users/MyName/appdata/local/android which is where it pointed in Android Studio. YOu can check where your installation points in Android Studio under File–>Settings—>Appereance and Behavior—>System Settings–>Android SDK.

Hope this works. Peace!


#9

I had to update my Repositories in the SDK Manager and everything worked!


#10

Hi, I am facing the same issue on ionic 2. Can you please elaborate on how did you solve the error? Anyone can please provide help on how to solve this issue.


#11

Just open the SDK Manager from Android Studio and update your Repositories!


#12

Same problem here, and I have updated all my Android repositories. Any suggestion?