Build issue with FCM plugin - FCMPlugin: Plugin install variables are not accessible, as package.json was unreachable/unreadable

In my ionic 5 application with capacitor, I am trying to implement push notifications with FCM plugin.

I have correctly setup my Firebase project and google-services.json file is also in place. It has been kept at android/app

However, when I build, it fails saying the following

Configure project :app
FCMPlugin: Plugin install variables are not accessible, as package.json was unreachable/unreadable.FCMPlugin: Plugin install variables are not accessible, as package.json was unreachable/unreadable.FCMPlugin: Plugin install variables are not accessible, as package.json was unreachable/unreadable.FCMPlugin: Support for Gradle v4 or lower is deprecated. Please upgrade to a newer version.google-services.json not found, google-services plugin not applied. Push Notifications won’t work

FAILURE: Build failed with an exception.

  • What went wrong:
    A problem occurred configuring project ‘:app’.

Could not create task ‘:app:processDebugGoogleServices’.
Cannot create a proxy class for abstract class ‘GoogleServicesTask’.

Why it says package.json is not reachable? When building the app for android, do i need to explicitly copy the package.json file?

Pls help me to fix this. Thanks…

Did you findm the solution?