A wonderful person opened a pull request in the cordova-firebase-plugin
official repo and it works.
Steps I did:
1 - Remove cordova-firebase-plugin with ionic cordova plugin remove cordova-firebase-plugin
2 - Install: ionic cordova plugin add https://github.com/dpa99c/cordova-plugin-firebase#GH-1057-April-05-android-build-issue
3 - rm -rf node_modules/ plugins/ platforms/android package-lock.json
4 - ionic cordova platform add android && npm install
5 - In my case I also use firebase js library in an old version becasue the newest ones are not working for me. With that library I always need to reinstall it manually after all the previous steps, so also I did: npm install firebase@4.12.1
.
And now it’s working.