cossacklabs / themis

Easy to use cryptographic framework for data protection: secure messaging with forward secrecy and secure data storage. Has unified APIs across 14 platforms.
https://www.cossacklabs.com/themis
Apache License 2.0
1.88k stars 143 forks source link

Error building react native after upgrade 0.15.2 #1035

Closed djaffer closed 1 year ago

djaffer commented 1 year ago
Task failed with an exception.

-----------

* What went wrong:

Execution failed for task ':react-native-themis:compileReleaseJavaWithJavac'.

> error: invalid source release: 17

* Try:

> Run with --stacktrace option to get the stack trace.

> Run with --info or --debug option to get more log output.

> Run with --scan to get full insights.

==============================================================================

2: Task failed with an exception.

-----------
vixentael commented 1 year ago

Thank you @djaffer , we will take a look (cc @radetsky )

radetsky commented 1 year ago

What version of JDK are you using? Run java --version in your terminal.

djaffer commented 1 year ago

its react native eas build so not sure.

djaffer commented 1 year ago

Previous version works perfectly fine.

radetsky commented 1 year ago

Thank you, we will take a look at this case. Anyway, you can still use the previous version or local builds. I tested local builds yesterday. It works perfectly. But the local JDK is 17.

radetsky commented 1 year ago

I built the fresh project with react-native-themis@0.15.2 with eas build command. It was successful. I look at the logs and see that gradlew version 8.0.1 is being used, which means that the eas system supports java version 17. Can you show the full build logs and show the eas.json from the project?

djaffer commented 1 year ago

Here you go

You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.

See ********docs.gradle.org/7.5.1/userguide/command_line_interface.html#sec:command_line_warnings

561 actionable tasks: 561 executed

FAILURE: Build completed with 2 failures.

1: Task failed with an exception.

-----------

* What went wrong:

Execution failed for task ':react-native-themis:compileReleaseJavaWithJavac'.

> error: invalid source release: 17

* Try:

> Run with --stacktrace option to get the stack trace.

> Run with --info or --debug option to get more log output.

> Run with --scan to get full insights.
djaffer commented 1 year ago

I also see this on expo. Maybe they are fixing it. image https://expo.dev/changelog/2023/11-03-node-default

radetsky commented 1 year ago

It seems to me that nodejs 18 support will not give the expected result. Maybe you need to update the expo sdk version, because a new project based on the latest expo sdk builds and works without any problems. And we always recommend using the latest versions of React Native.

In your case, the eas build system cannot recognize files that were compiled in Java version 17.

djaffer commented 1 year ago

thanks, the issue was node version/base image. In eas.json added image: latest attribute. Likely not relevant to expo sdk but rather the base image's node and java version.

https://docs.expo.dev/build-reference/infrastructure/#ubuntu-2204-jdk-11-ndk-r21e-alias-default

"ios": {
        "image": "latest",
      },
"android": {
        "image": "latest"
      }