Gradle error In building apk

Seeing this error again and again
UserError: FAILURE: Build completed with 2 failures. Gradle error. See log for more information.
zip file
Please help

Start by updating your plugins - they are all out of date. A lot has changed over the years in Android, so you have some catching up to do:

cordova-plugin-geolocation ~2.1.0 --> 4.1
cordova-plugin-network-information ~1.2.0 --> 2.0.2
cordova-plugin-whitelist ~1.2.1 --> 1.3.4
cordova.plugins.diagnostic 4.0.0 --> 6.0.3
phonegap-plugin-push" spec="2.0.0 --> 2.3.0

Other changes may also be needed.

I updated all the plugins
now got a new issue

Please help
Still not solved i have updated all the plugins
Here are some details that can be helpful

  1. in push plugin ver 2.0.0 it says gradle error
  2. in push plugin ver 2.0.3 it say google.json file missing
    I am putting google.json file in all folder still saying it is missing

Please help :frowning:

Here are the magic lines you need:

<preference name="AndroidXEnabled" value="true" />
<plugin name="cordova-plugin-androidx-adapter" />
<preference name="AndroidXEnabled" value="true" />
<plugin name="@havesource/cordova-plugin-push" spec="2.0.0" />
<platform name="android">
    <resource-file src="google-services.json" target="/app/google-services.json" />
</platform>

You needed to replace phonegap-plugin-push with its modern replacement, which is @havesource/cordova-plugin-push.

You also need to deal with AndroidX, the replacement for the Android Support Library.

Thanks alot it worked. You are an angel