Ionic 4 Cordova - Run Android Firebase error all of a sudden

the solution is : https://github.com/arnesson/cordova-plugin-firebase/issues/1057#issuecomment-490004765

rewrite platforms/android/app/build.gradle and platforms/android/project.properties by updating :

cordova.system.library.4=com.google.firebase:firebase-core:16.0.8 cordova.system.library.5=com.google.firebase:firebase-messaging:17.5.0 cordova.system.library.6=com.google.firebase:firebase-config:16.4.1 cordova.system.library.7=com.google.firebase:firebase-perf:16.2.4

This seems more a workaround then a real solution… developers should avoid to change data in platform directotyor as well plugins directory because its are generated…

1 Like

Google support libraries are deprecated (April, I think). So you have to lock your libraries for now.

Try this, worked for me. You have to make changes in the FCM project files -

Gazzab Bro Gazzab…

ok,this what works for me

“cordova-plugin-firebase”: “2.0.5”,

project.properties file

cordova.system.library.6=com.google.android.gms:play-services-tagmanager:16+ cordova.system.library.7=com.google.firebase:firebase-core:16.0.9 cordova.system.library.8=com.google.firebase:firebase-messaging:17+ cordova.system.library.9=com.google.firebase:firebase-config:16+ cordova.system.library.10=com.google.firebase:firebase-perf:16.2.4

build.gradle file

buildscript {
repositories {
google()
jcenter()
mavenCentral()
maven {
url “https://maven.google.com
}
maven {
url ‘https://maven.fabric.io/public
} }
dependencies {

    // NOTE: Do not place your application dependencies here; they belong
    // in the individual module build.gradle files
    classpath 'com.android.tools.build:gradle:3.0.1'
    classpath 'com.google.gms:google-services:4.2.0' // google-services dependency from cordova-plugin-firebase
    classpath 'io.fabric.tools:gradle:1.25.4' // fabric dependency from cordova-plugin-firebase
}

}

allprojects {
repositories {
google()// add it to top instead of bottom or somewhere in middle
mavenLocal()
mavenCentral()
maven {
url ‘https://maven.google.com
}

    jcenter()
}
//This replaces project.properties w.r.t. build settings
project.ext {
  defaultBuildToolsVersion="27.0.1" //String
  defaultMinSdkVersion=19 //Integer - Minimum requirement is Android 4.4
  defaultTargetSdkVersion=27 //Integer - We ALWAYS target the latest by default
  defaultCompileSdkVersion=27 //Integer - We ALWAYS compile with the latest by default
}

}

1 Like

not work for me
But after several attempts I have reached to this

from

cordova.system.library.6=com.google.android.gms:play-services-tagmanager:16+ cordova.system.library.7=com.google.firebase:firebase-core:16.0.9 cordova.system.library.8=com.google.firebase:firebase-messaging:17+ cordova.system.library.9=com.google.firebase:firebase-config:16+ cordova.system.library.10=com.google.firebase:firebase-perf:16.2.4

to

cordova.system.library.5=com.google.android.gms:play-services-tagmanager:+
cordova.system.library.6=com.google.firebase:firebase-core:+
cordova.system.library.8=com.google.firebase:firebase-messaging:17+
cordova.system.library.9=com.google.firebase:firebase-config:16+
cordova.system.library.10=com.google.firebase:firebase-perf:16.2.4

Thank you very much. It works for me

ionic start myApp tabs
cd myApp
ionic cordova platform add android@latest
ionic cordova plugin add cordova-plugin-firebase --save
ionic cordova build android
//FAIL. The library com.google.android.gms:play-services-measurement-base is being requested by various other libraries at [[16.5.0,16.5.0], [16.4.0,16.4.0]], but resolves to 16.5.0.

it seems everybody has a case by case solution but it is not even working on a brand vanilla app anymore.
i would expect there to be a more general solution.

I for myself have tried everything mentioned here without any luck.
So, push notifications is now gone for ionic?

Hey outspoken_mag,

I had the same error as you and managed to solve it by firstly editing in project.properties (in platforms/android), by fixing the following versions (as has been answered above):

cordova.system.library.2=com.google.android.gms:play-services-tagmanager:16+
cordova.system.library.3=com.google.firebase:firebase-core:16.0.8
cordova.system.library.4=com.google.firebase:firebase-messaging:17.5.0
cordova.system.library.5=com.google.firebase:firebase-config:16.4.1
cordova.system.library.6=com.google.firebase:firebase-perf:16.2.4

After you edit that file run ionic cordova build android, and then try building.

In my case after I fixed the versions on the one file I needed to build in order for all the files to be set to the pre-specified versions.

thank you for your reply!
I wanted to build within the console and therefore there was no project file

I figured a way (maybe it is of help to someone)
So here is what I did step by step:

remove these directories (after a fresh install not necessary)
platforms
node-modules
plugins

then the following steps

  1. ionic cordova plugin add cordova-plugin-firebase --save
  2. open your plugins folder and find the plugins.xml within the firebase directory and open it
  3. replace the framework tags with the following

<framework src="com.google.android.gms:play-services-tagmanager:16+" /> <framework src="com.google.firebase:firebase-core:16.0.8" /> <framework src="com.google.firebase:firebase-messaging:17.5.0" /> <framework src="com.google.firebase:firebase-config:16.4.1" /> <framework src="com.google.firebase:firebase-perf:16.2.4" />

  1. ionic cordova platform add android
  2. ionic cordova build android
2 Likes

Thanks.

This works for me:

\platforms\android\project.properties

cordova.system.library.5=com.google.firebase:firebase-core:16.0.8

cordova.system.library.6=com.google.firebase:firebase-messaging:17.5.0

cordova.system.library.7=com.google.firebase:firebase-crash:+

cordova.system.library.8=com.google.firebase:firebase-config:16.4.1
2 Likes

Thanks, it worked for me also

Thank you so much took me two days to figure it out.

1 Like

This works for me!! Thxs!

This was working fine for me using these values.

cordova.system.library.3=com.google.firebase:firebase-core:16.0.8
cordova.system.library.4=com.google.firebase:firebase-messaging:17.5.0
cordova.system.library.5=com.google.firebase:firebase-config:16.4.1
cordova.system.library.6=com.google.firebase:firebase-perf:16.2.4

I’m using Android-cordova 6.4

But now building android I’m getting this.

he library com.google.firebase:firebase-iid is being requested by various other libraries at [[17.1.1,17.1.1]], but resolves to 19.0.0. Disable the plugin and check your dependencies tree using ./gradlew :app:dependencies.

I’m also getting same error from today

got this fixed after adding
cordova.system.library.1=com.google.android.gms:play-services-tagmanager:16.0.8

I am still receiving following error: Failed to execute aapt
com.android.ide.common.process.ProcessException: Failed to execute aapt

android:attr/fontVariationSettings not found.
android:attr/ttcIndex not found.

Does anybody have any ideas?

Also getting this error as of today:

Execution failed for task ':app:processDebugResources'.
> Failed to execute aapt
 AAPT: error: resource android:attr/fontVariationSettings not found.
 AAPT: error: resource android:attr/ttcIndex not found.

Current Project Properties:

cordova.system.library.3=com.google.android.gms:play-services-tagmanager:16+
cordova.system.library.4=com.google.firebase:firebase-core:16.0.8
cordova.system.library.5=com.google.firebase:firebase-messaging:17.5.0
cordova.system.library.6=com.google.firebase:firebase-config:16.4.1
cordova.system.library.7=com.google.firebase:firebase-perf:16.2.4

AND if play-services-tagmanager:+
THEN

The library com.google.firebase:firebase-iid is being requested by various other libraries at [[17.1.1,17.1.1]], but resolves to 19.0.0. Disable the plugin and check your dependencies tree using ./gradlew :app:dependencies.