chariotsolutions / phonegap-nfc

PhoneGap NFC Plugin
MIT License
706 stars 556 forks source link

Error Build Cordova - error: diamond operator is not supported in -source 1.6 #332

Closed luizalexandrew closed 5 years ago

luizalexandrew commented 5 years ago

I'm trying to build using version 1.0.3 of the plugin and is giving this error captura de tela de 2018-07-04 18-40-24

cordova 7.1.0 android-platform 6.4.0 java version "1.8.0_171"

I downgraded to version 0.7.3 and this version is working

VolodymyrAndrushchak commented 5 years ago

@luizalexandrew Just change JAVA_VERSION on 1_8 in your gradle file

don commented 5 years ago

@luizalexandrew, did @VolodymyrAndrushchak 's suggestion work for you?

Thayakaran commented 5 years ago

@VolodymyrAndrushchak where to find gradle file in Ionic 2. i'm new to ionic. got same issue please help me. Thanks in advance.

tylervz commented 5 years ago

@VolodymyrAndrushchak while that may be a fix for local builds, all cloud builds from a service such as Adobe PhoneGap Build will fail.

peikezot commented 5 years ago

Did anyone find a workaround for the cloud builds? I'm using the cloud service from Adobe's build.phonegap.com and it is indeed complaining about the diamond operators and the lambdas.

fsobarzo commented 5 years ago

@VolodymyrAndrushchak JAVA_VERSION on 1_8 need Jack, but this is deprecated

https://source.android.com/setup/build/jack

Warning: As of this March 14, 2017 announcement, the Jack toolchain is deprecated. Jack was the default Android build toolchain for Android 6.0–8.1.

sabri-dundar commented 5 years ago

https://www.youtube.com/watch?v=AQ3-i4BqOrA

fsobarzo commented 5 years ago

I got this error after enable java 1.8 and jackOptions.

* What went wrong:
Execution failed for task ':transformClassesWithPreJackPackagedLibrariesForDebug'.
> java.lang.NullPointerException (no error message)
fsobarzo commented 5 years ago

@luizalexandrew you can find a solution ?

fredmaggiowski commented 5 years ago

Since I couldn't upgrade Java compiler version in my cordova-based project I've had to fork the project and patch the code in order to support older java 1.6.

Here the diff.

If you're interested in the changes I could clean up the code a bit and make a pull request.

don commented 5 years ago

The best fix is to change the compiler to use a newer language level. Alternately you can try and older version of the plugin without the newer language features.

adibisna commented 5 years ago

@luizalexandrew Just change JAVA_VERSION on 1_8 in your gradle file

it works for me. thanks

KaiBirkenstock commented 5 years ago

use this fork: https://github.com/fredmaggiowski/phonegap-nfc

kumquat601 commented 5 years ago

@fredmaggiowski 's hack working.

at least, build successful.