Ionic - prod build gets error due to AngularFire2 issues

For whatever reason, I get the errors with ionic cordova build --prod android, but no errors with cordova build --prod android. Strange.