chariotsolutions / phonegap-nfc

PhoneGap NFC Plugin
MIT License
706 stars 555 forks source link

Error compiling on build.phonegap #367

Closed deadcalf closed 4 years ago

deadcalf commented 5 years ago

When we try to compile the script on build.phonegap it shows to errors and stops compiling it says: /var/gimlet/tmp/47026722182480/3614989/project/src/com/chariotsolutions/nfc/plugin/NfcPlugin.java:80: error: diamond operator is not supported in -source 1.6 private final List intentFilters = new ArrayList<>(); ^ (use -source 7 or higher to enable diamond operator) /var/gimlet/tmp/47026722182480/3614989/project/src/com/chariotsolutions/nfc/plugin/NfcPlugin.java:214: error: lambda expressions are not supported in -source 1.6 Any suggestions?

Adza93 commented 4 years ago

Same issue on ionic 3.9.8.

Any workarounds?

don commented 4 years ago

PhoneGap build defaults to cli-6.5.0, which can't handle new Java or JavaScript. Update the phonegap-version to cli-9.0.0 by adding a preference to config.xml.

<preference name="phonegap-version" value="cli-9.0.0" />
<plugin name="phonegap-nfc" source="npm" />