App fails to build after updating android platform

My application was running fine until I used the following commands

  1. ionic cordova platform rm android
  2. ionic cordova platform add android

The plugin in question is Onesignal which was working fine before, its errors give this;
(link)\platforms\android\gradlew: Command failed with exit code 1 Error output:
(link)\platforms\android\app\src\main\java\com\plugin\gcm\OneSignalOutcomeController.java:25: error: unreported CallbackHelper.callbackSuccess(jsSendUniqueOutcomeCallback, outcomeEvent.toJSONObject());

This is the error I get;

  • What went wrong:
    Execution failed for task ā€˜:app:compileDebugJavaWithJavacā€™.

Compilation failed; see the compiler error output for details.

And this is my Ionic Info;
Ionic:

Ionic CLI : 5.4.16 (C:\Users\Kent\AppData\Roaming\npm\node_modules\ionic)
Ionic Framework : @ionic/angular 5.1.1
@angular-devkit/build-angular : 0.901.6
@angular-devkit/schematics : 9.1.6
@angular/cli : 9.1.6
@ionic/angular-toolkit : 2.2.0

Cordova:

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

Utility:

cordova-res (update available: 0.14.0) : 0.9.0
native-run (update available: 1.0.0) : 0.3.0

System:

Android SDK Tools : 26.1.1 (C:\Users\Kent\AppData\Local\Android\Sdk)
NodeJS : v10.15.3 (C:\Program Files\nodejs\node.exe)
npm : 6.4.1
OS : Windows 10

1 Like

I have the same problem in ionic 4.

My problem was resolved downgrading version of onesignal-cordova-plugin from 2.10.0 to 2.9.1.

1 Like

Let me try it out, sounds to be a good idea.