Search code examples
javacordovacode-push

Cordova Code Push - multi-catch statement is not supported in -source 1.6


Similar to multi-catch statement is not supported in -source 1.6 (use -source 7 or higher to enable multi-catch statement)

I've just installed Code Push and the Cordova code push plugin and I'm getting the error:

platforms\android\src\com\microsoft\cordova\CodePush.java:652: error: multi-catch statement is not supported in -source 1.6
              } catch (IllegalAccessException | InvocationTargetException e) {
                                              ^
  (use -source 7 or higher to enable multi-catch statement)

I'm running Java 8 on this machine. When I run java -version I get

java version "1.8.0_171"
Java(TM) SE Runtime Environment (build 1.8.0_171-b11)
Java HotSpot(TM) Client VM (build 25.171-b11, mixed mode, sharing)

Where would this be coming from?

I've checked through config.xml and package.json, and searched the folder and I can't find any reference to 1.6..


Solution

  • New release fixed this issue. https://github.com/Microsoft/cordova-plugin-code-push/releases/tag/v1.11.15

    Update your cordova-plugin-code-push to 1.11.15 or latest version.