Ionic 3 Project evaluation failed including an error in afterEvaluate {}

Good evening
i have an ionic 3 app which uses FCM for push notifications
I have the android 8 platform installed
when i try to do cordova build command i got the error:

Project evaluation failed including an error in afterEvaluate {}. Run with --stacktrace for details of the afterEvaluate {} error.

FAILURE: Build failed with an exception.

  • Where:
    Script ‘C:\IONIC\AlloPressing\platforms\android\cordova-plugin-fcm-with-dependecy-updated\starter-FCMPlugin.gradle’ line: 16

  • What went wrong:
    A problem occurred evaluating script.

Cannot invoke method lastIndexOf() on null object

  • Try:
    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

  • Get more help at https://help.gradle.org

BUILD FAILED in 1m 8s

Configure project :app
c:\IONIC\AlloPressing\platforms\android\gradlew: Command failed with exit code 1 Error output:
Project evaluation failed including an error in afterEvaluate {}. Run with --stacktrace for details of the afterEvaluate {} error.

please how to correct this?

What is the output of running ionic info?
Has this project ever built properly?
If so, what has changed between the last time it built properly and now?

Ionic:

Ionic CLI : 5.4.16 (C:\Users\Mr Kaplan\AppData\Roaming\npm\node_modules\ionic)
Ionic Framework : ionic-angular 3.9.9
@ionic/app-scripts : 3.2.4

Cordova:

Cordova CLI : 10.0.0
Cordova Platforms : android 8.1.0
Cordova Plugins : cordova-plugin-ionic-keyboard 2.2.0, cordova-plugin-ionic-webview 4.2.1, (and 5 other plugins)

Utility:

cordova-res : 0.15.2
native-run : not installed

System:

Android SDK Tools : 24.4.1 (C:\android-sdk)
NodeJS : v12.13.0 (C:\Program Files (x86)\nodejs\node.exe)
npm : 6.12.0
OS : Windows 10

the project was running well
the problem started after I reinstalled my operating system

I solved my problem by switching from version 7.1 to version 7.0 of the cordova-plugin-fcm-with-dependecy-updated plugin with the following commands:

cordova plugin rm cordova-plugin-fcm-with-dependecy-updated
cordova plugin add cordova-plugin-fcm-with-dependecy-updated@7.0

3 Likes