AllInOneYT / react-native-thermal-printer

MIT License
102 stars 53 forks source link

Build failed on RN 0.71.7 using `version: 2.3.6` #53

Closed lfrallon closed 1 year ago

lfrallon commented 1 year ago
FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring root project 'MyApp'.
> Could not open cp_proj generic class cache for build file '/home/user/MyApp/android/build.gradle' (/home/user/.gradle/caches/7.6/scripts/c5xcu30qxwstonq4c7hkbzhoo).
   > BUG! exception in phase 'semantic analysis' in source unit '_BuildScript_' Unsupported class file major version 64

* 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.

* Get more help at https://help.gradle.org

BUILD FAILED in 8s

error Failed to install the app. Make sure you have the Android development environment set up: https://reactnative.dev/docs/environment-setup.
Error: Command failed: ./gradlew app:installDebug -PreactNativeDevServerPort=8081

FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring root project 'MyApp'.
> Could not open cp_proj generic class cache for build file '/home/user/MyApp/android/build.gradle' (/home/user/.gradle/caches/7.6/scripts/c5xcu30qxwstonq4c7hkbzhoo).
   > BUG! exception in phase 'semantic analysis' in source unit '_BuildScript_' Unsupported class file major version 64

* 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.

* Get more help at https://help.gradle.org

BUILD FAILED in 8s

Java: openjdk version "20" 2023-03-21 OpenJDK Runtime Environment (Red_Hat-20.0.0.0.36-1.rolling.fc38) (build 20+36) OpenJDK 64-Bit Server VM (Red_Hat-20.0.0.0.36-1.rolling.fc38) (build 20+36, mixed mode, sharing)

Dependencies:

react-native@0.71.7 react-native-thermal-printer@2.3.6

Android Version: 12

lfrallon commented 1 year ago

The recommended Java version for react-native is 11 since there are lots of problems in the latest version. But the default version on my system is configured using java version 20, so, I need to set up my Java config into 11.

Now using:

openjdk version "11.0.19" 2023-04-18
OpenJDK Runtime Environment (Red_Hat-11.0.19.0.7-2.fc38) (build 11.0.19+7)
OpenJDK 64-Bit Server VM (Red_Hat-11.0.19.0.7-2.fc38) (build 11.0.19+7, mixed mode, sharing)