Firebase App unable to Compile on Android with AAPT error

i m getting this error also after run the command of ionic cordova run android

ERROR - Crashlytics Developer Tools error.
java.lang.IllegalArgumentException: Crashlytics found an invalid API key: null.
Check the Crashlytics plugin to make sure that the application has been added successfully!
Contact for assistance

this. is my plug in list

com-badrit-base64 0.2.0 “Base64”
cordova-plugin-android-permissions 1.0.0 “Permissions”
cordova-plugin-androidx 1.0.2 “cordova-plugin-androidx”
cordova-plugin-androidx-adapter 1.0.2 “cordova-plugin-androidx-adapter”
cordova-plugin-camera 4.0.3 “Camera”
cordova-plugin-crop 0.3.1 “CropPlugin”
cordova-plugin-device 2.0.2 “Device”
cordova-plugin-file 6.0.1 “File”
cordova-plugin-file-transfer 1.7.1 “File Transfer”
cordova-plugin-firebase 2.0.5 “Google Firebase Plugin”
cordova-plugin-google-analytics 1.8.6 “Google Universal Analytics Plugin”
cordova-plugin-ionic-keyboard 2.1.3 “cordova-plugin-ionic-keyboard”
cordova-plugin-ionic-webview 1.2.1 “cordova-plugin-ionic-webview”
cordova-plugin-media-capture 3.0.2 “Capture”
cordova-plugin-network-information 2.0.1 “Network Information”
cordova-plugin-splashscreen 5.0.2 “Splashscreen”
cordova-plugin-telerik-imagepicker 2.3.2 “ImagePicker”
cordova-plugin-video-editor 1.1.3 “VideoEditor”
cordova-plugin-whitelist 1.3.3 “Whitelist”
cordova-plugin-zip 3.1.0 “cordova-plugin-zip”


You save my life!!! I spent 4 days to find a solution, thanks a lot

It worked for me, tnks.

I have applied also arcseldon answer from

Then I opened it through Android Studio and clean the project with “Build > Clean Project” from the menu. After that everything worked fine.

Actually, I need to set my CORDOVA_ANDROID_GRADLE_DISTRIBUTION_URL to .bash_profile

it will help to you also alexasilock

process went a tep further after updating my versions to those but it still failed. I think the problem is I have other libraries as :

So where can I find proper version for those libraries as well ? Thanks

I want to try this method but I am scared my plugins won’t work lol. Did you guys have any issue with plugins after upgrade ?

UPDATE: You can skip the updating of cordova android and just modify the firebase-core and firebase-messaging versions. I had other issues using cordova 8.0.0… I.E. I could no longer tap into input fields that exist inside ion-content when the app first loaded unless I first tapped somewhere else on the screen… Everything is working successfully on cordova 7.1.0

I had this issue…

My solution was to upgrade to android 8.0.0 and then edited the project properties file to version lock firebase messaging to 17.5.0 and firebase core to 16.0.8.

Was able to build after that.


ionic cordova platform rm android
ionic platform add android@8.0.0

Edit: file in platforms/android

Thanks a lot, and this works!
You saved me from getting fired

1 Like

Worked for me, thanks !!

Does any one facing http request failure while running the app in real deviecs. I am unable to open http urls but https services are working fine.

This solution solved my problem Thanks a lot…I was banging my head from yesterday

This solution worked for me paired with this fork of cordova-plugin-firebase:


Many thanks. This works!:+1:

I followed the steps, the build was done successfully, but when running the application it is not requested http and it presents an error.

how can I solve this problem if I can’t upgrade my cordova-android@7.1.4 to 8?
I have to use 7.1.4 because of some incompatible plugins.

Thanks to @JorgeU for putting me on the right path. Lifesaver.

Solution didn’t entirely work because I was still getting a Firebase Crashlytics Error.

* What went wrong:
Execution failed for task ':app:fabricGenerateResourcesDebug'.
> Crashlytics Developer Tools error.

Thankfully, as you said, reading the full post helped, as the author you mentioned specified some additional info for firebase errors on the Stack Overflow post

These are the exact steps I took. 10 hours of no progress and suddenly my app was building again. If you get any errors make sure to read the full post from the Stack Overflow author and any of the hyperlinks he provides to packages. The packages themselves have their own version requirements so make sure you have up to date versions of everything.

  1. Run:
cordova plugin add cordova-plugin-androidx
  1. Run:
cordova plugin add cordova-plugin-androidx-adapter

2.5 (not sure if this one is necessary but I did it in response to some warnings) Run:

npm i -g cordova-res
  1. Run:
ionic cordova remove platform android 
  1. Run:
cordova plugin remove cordova-plugin-firebase
  1. Run:
npm install
  1. Run:
cordova plugin add cordova-plugin-firebasex
  1. Run:
ionic cordova platform add android 
  1. (Voila!) Run:
ionic cordova build android

Hope it works for anyone getting the firebase crashlytics error.

same error here, any solutions ?

This issue worked for me. Thanks!

This worked for me too - thanks

1 Like

Thanx a ton, I wasted a whole day trying to fix this.