Builds failing in iOS / Android in ionic pro

When I try to build the app, iOS or Android, I got this error

Failed to install 'cordova-plugin-ionic': CordovaError: Version of installed plugin: "cordova-plugin-ionic-webview@1.2.1" does not satisfy dependency plugin requirement "cordova-plugin-ionic-webview@>=2.0.0". Try --force to use installed plugin as dependency.
    at /usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/plugman/install.js:557:37
    at _fulfilled (/usr/local/lib/node_modules/cordova/node_modules/q/q.js:787:54)
    at self.promiseDispatch.done (/usr/local/lib/node_modules/cordova/node_modules/q/q.js:816:30)
    at Promise.promise.promiseDispatch (/usr/local/lib/node_modules/cordova/node_modules/q/q.js:749:13)
    at /usr/local/lib/node_modules/cordova/node_modules/q/q.js:509:49
    at flush (/usr/local/lib/node_modules/cordova/node_modules/q/q.js:108:17)
    at _combinedTickCallback (internal/process/next_tick.js:131:7)
    at process._tickCallback (internal/process/next_tick.js:180:9)
Failed to restore plugin "cordova-plugin-ionic" from config.xml. You might need to try adding it again. Error: Version of installed plugin: "cordova-plugin-ionic-webview@1.2.1" does not satisfy dependency plugin requirement "cordova-plugin-ionic-webview@>=2.0.0". Try --force to use installed plugin as dependency.

It’s happening since today.

I tried to build previous successful builds but got same error

What is wrong ?
Thanks.

Hi,
Same error ?
I tried to place “cordova-plugin-ionic-webview@>=2.0.0” in the config.xlm
but i’s still not running.

I found the solution

cordova plugin rm cordova-plugin-ionic-webview
cordova plugin add cordova-plugin-ionic-webview@latest
1 Like

Great !
Many thanks.

Hey all,

I’ve run ionic cordova plugin add cordova-plugin-ionic-webview@latest however when I then run ionic cordova build android I am getting the following error:

BUILD FAILED in 5s
36 actionable tasks: 34 executed, 2 up-to-date
Error: /Websites/.../platforms/android/gradlew: Command failed with exit code 1 Error output:
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
/Users/.../.gradle/caches/transforms-1/files-1.1/firebase-iid-16.2.0.aar/b603d65ba3d5865eaa66240d08090b1e/jars/classes.jar(com/google/firebase/iid/FirebaseInstanceId.class): warning: Cannot find annotation method 'value()' in type 'GuardedBy': class file for javax.annotation.concurrent.GuardedBy not found
/Users/.../.gradle/caches/transforms-1/files-1.1/firebase-iid-16.2.0.aar/b603d65ba3d5865eaa66240d08090b1e/jars/classes.jar(com/google/firebase/iid/FirebaseInstanceId.class): warning: Cannot find annotation method 'value()' in type 'GuardedBy'
/Users/.../.gradle/caches/transforms-1/files-1.1/firebase-iid-16.2.0.aar/b603d65ba3d5865eaa66240d08090b1e/jars/classes.jar(com/google/firebase/iid/FirebaseInstanceId.class): warning: Cannot find annotation method 'value()' in type 'GuardedBy'
/Websites/.../platforms/android/src/com/ionicframework/common/IonicCordovaCommon.java:72: error: strings in switch are not supported in -source 1.6
    switch(action) {
          ^
  (use -source 7 or higher to enable strings in switch)
/Websites/.../platforms/android/src/com/ionicframework/common/IonicCordovaCommon.java:144: error: cannot find symbol
    SharedPreferences prefs = this.cordova.getContext().getSharedPreferences("com.ionic.deploy.preferences", Context.MODE_PRIVATE);
                                          ^
  symbol:   method getContext()
  location: variable cordova of type CordovaInterface
/Websites/.../platforms/android/src/com/ionicframework/common/IonicCordovaCommon.java:201: error: cannot find symbol
    SharedPreferences prefs = this.cordova.getContext().getSharedPreferences("com.ionic.deploy.preferences", Context.MODE_PRIVATE);
                                          ^
  symbol:   method getContext()
  location: variable cordova of type CordovaInterface
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
3 errors
3 warnings

Notable lines are the ionic lines:

/Websites/.../platforms/android/src/com/ionicframework/common/IonicCordovaCommon.java:201: error: cannot find symbol
    SharedPreferences prefs = this.cordova.getContext().getSharedPreferences("com.ionic.deploy.preferences", Context.MODE_PRIVATE);
                                          ^

Seems like Ionic is still having an issue? Anyone else have this problem? I’ve tried updating my ionic plugins to the latest versions, even beta releases but still no dice.

But it freezes on the splashscreen for me…

1 Like

Yeah, me too! Any solution?

I have re-done the whole process to deploy using ionic Pro and it ran.

uninstall,
re-install and other.

thanks.

Can you describe the process step-by-step please

1 Like

First :
cordova plugin rm cordova-plugin-ionic-webview
cordova plugin add cordova-plugin-ionic-webview@latest

and all the process from the video linked below (Cordova install + build again)

Thank u AchilleProjets :3