Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unknown Kotlin JVM target: 20 #1953

Closed
renishdeveloper opened this issue Nov 2, 2023 · 7 comments
Closed

Unknown Kotlin JVM target: 20 #1953

renishdeveloper opened this issue Nov 2, 2023 · 7 comments
Labels
Missing repro This issue need minimum repro scenario Platform: Android This issue is specific to Android

Comments

@renishdeveloper
Copy link

Description

I'm using the package with react native project having react native version 0.72.6, I"m getting the error that is there in the below screenshot.
image

Steps to reproduce

  1. Create react native project and install this package and run the project using npx react-native run-android.

Snack or a link to a repository

not possible to share the repo

Screens version

3.27.0

React Native version

0.72.6

Platforms

Android

JavaScript runtime

Hermes

Workflow

React Native (without Expo)

Architecture

Fabric (New Architecture)

Build type

Debug mode

Device

Android emulator

Device model

No response

Acknowledgements

Yes

@github-actions github-actions bot added Platform: Android This issue is specific to Android Missing repro This issue need minimum repro scenario labels Nov 2, 2023
Copy link

github-actions bot commented Nov 2, 2023

Hey! 👋

The issue doesn't seem to contain a minimal reproduction.

Could you provide a snack or a link to a GitHub repository under your username that reproduces the problem?

@tboba
Copy link
Member

tboba commented Nov 2, 2023

Hi @renishdeveloper, thanks for submitting this issue!

Unfortunately, this issue is not reproducible for me. I've created new project via create-react-native-app, I've added react-native-screens and tried npx react-native run-android - no issues there, the app is being built correctly.
My first assumptions is the wrong version of Java installed locally - in my case I'm using openjdk 11.0.20 from Zulu.
Also, do you have jvmTarget specified in your gradle files? If so, what is the version you're using in the project?

Cheers!

@tboba tboba added the Close when stale This issue is going to be closed when there is no activity for a while label Nov 2, 2023
@indiademo
Copy link

Hi @tboba i am facing this issue in 2 application when i install react-native-screens

Task :react-native-screens:compileReleaseKotlin FAILED

Task :react-native-safe-area-context:compileReleaseKotlin
'compileReleaseJavaWithJavac' task (current target is 11) and 'compileReleaseKotlin' task (current target is 1.8) jvm target compatibility should be set to the same Java version.
w: /Users/abhishekpathak/project/ui/RedRose/node_modules/react-native-safe-area-context/android/src/main/java/com/th3rdwave/safeareacontext/SafeAreaView.kt: (58, 23): 'getter for uiImplementation: UIImplementation!' is deprecated. Deprecated in Java

@github-actions github-actions bot removed the Close when stale This issue is going to be closed when there is no activity for a while label Nov 5, 2023
@mrtomhoward
Copy link

I struck this today after doing something completely unrelated to react-native-screens. I installed react-native-vision-camera and react-native-fs, then started getting this error each time I tried to build even after I removed those libs (and yes, trashed yarn.lock and node_modules/*, reinstalled everything and ran npx jetify each time).

The thing that fixed it for me was commenting out export JAVA_HOME=$HOME/OpenJDK/jdk-20.0.2.jdk/Contents/Home/ in my .zshrc file.

After that, for java --version I get java 11.0.18, and the builds work again.

Its' wierd that this suddenly came up, as I've had that OpenJDK version installed/used for a while and it was building fine as recently as yesterday.

@indiademo
Copy link

Hi @mrtomhoward ,

  Thanks for your response, i also yesterday downgrade my java version 20 to 11 and working fine for me also.

This is issue with latest java version.

@kkafar
Copy link
Member

kkafar commented Nov 16, 2023

RN uses Java 11 on versions before 73 (or 72, I do not recall exactly), and 17 for later versions. We do not test for compatibility with Java 20.

@kkafar kkafar closed this as completed Nov 16, 2023
@phgn0
Copy link

phgn0 commented May 17, 2024

^ brew uninstall java --ignore-dependencies && brew install java17 fixed this issue for me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Missing repro This issue need minimum repro scenario Platform: Android This issue is specific to Android
Projects
None yet
Development

No branches or pull requests

6 participants