chariotsolutions / phonegap-nfc

PhoneGap NFC Plugin
MIT License
706 stars 556 forks source link

lambda expressions are not supported in -source 1.6 #339

Closed barbax closed 5 years ago

barbax commented 5 years ago

Hello, trying to use this plugin we are receiving a strange compiling problem: ../platforms/android/src/com/chariotsolutions/nfc/plugin/NfcPlugin.java:800: error: lambda expressions are not supported in -source 1.6 this.cordova.getThreadPool().execute(() -> { ^ (use -source 8 or higher to enable lambda expressions) Any idea how to solve this?

Regards

Wade-BuildOtto commented 5 years ago

did you solve this?

MeMyselfI commented 5 years ago

I just rewrote the Java 8 parts /shrug

grimaldistudio commented 3 years ago

I had exactly the same issue. I have Java 8 in my machines but the plugin tries to compile with the old Java 6 i manually edited build.gradle in this mode:

platform/android/build.gradle

compileOptions { sourceCompatibility JavaVersion.VERSION_1_6 targetCompatibility JavaVersion.VERSION_1_6 }

with:

compileOptions { sourceCompatibility JavaVersion.VERSION_1_8 targetCompatibility JavaVersion.VERSION_1_8 }