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

* What went wrong: Execution failed for task ':shopify_flash-list:compileReleaseKotlin'. > 'compileReleaseJavaWithJavac' task (current target is 11) and 'compileReleaseKotlin' task (current target is 17) jvm target compatibility should be set to the same Java version. Consider using JVM toolchain: https://kotl.in/gradle/jvm/toolchain #933

Open
sonuwise opened this issue Oct 17, 2023 · 7 comments
Labels
bug Something isn't working

Comments

@sonuwise
Copy link

sonuwise commented Oct 17, 2023

If add the kotlin version to build.gradle then react native gesture handler packages throws error. Kindly assist me

@sonuwise sonuwise added the bug Something isn't working label Oct 17, 2023
@L0rdCr1s
Copy link

in your android>build.gradle file add

buildscript {
     ext {
        ....
        kotlinVersion = "1.8.10"
       ...

in your android>app>build.gradle add

android {
    .....
    composeOptions {
          kotlinCompilerExtensionVersion = "1.4.4"
    }
    .....

I hope this helps

@sonuwise
Copy link
Author

sonuwise commented Oct 18, 2023

@L0rdCr1s

in your android>build.gradle file add

buildscript {
     ext {
        ....
        kotlinVersion = "1.8.10"
       ...

in your android>app>build.gradle add

android {
    .....
    composeOptions {
          kotlinCompilerExtensionVersion = "1.4.4"
    }
    .....

I hope this helps

in your android>build.gradle file add

buildscript {
     ext {
        ....
        kotlinVersion = "1.8.10"
       ...

in your android>app>build.gradle add

android {
    .....
    composeOptions {
          kotlinCompilerExtensionVersion = "1.4.4"
    }
    .....

I hope this helps

I getting react native gesture handle issue if use this ``Execution failed for task ':react-native-gesture-handler:compileDebugKotlin'.

'compileDebugJavaWithJavac' task (current target is 11) and 'compileDebugKotlin' task (current target is 17) jvm target compatibility should be set to the same Java version.
Consider using JVM toolchain: https://kotl.in/gradle/jvm/toolchain``

Im using react-native-gesture-handler-version:2.13.3
and if fix this then react-native-safe-area-context pops up with the same above error

@itajenglish
Copy link

+1

@Moatezz
Copy link

Moatezz commented Oct 19, 2023

+2 I had to uninstall the package and comment on every Flashlist component and they're a lot in my app just to get it to show me the login screen can I expect a swift fix for this bug or should I look for alts?

@Neiso
Copy link

Neiso commented Aug 30, 2024

I fixed this by forcing flash-list to use Java 11.

~ java --version
openjdk 11.0.15 2022-04-19 LTS
OpenJDK Runtime Environment Zulu11.56+19-CA (build 11.0.15+10-LTS)
OpenJDK 64-Bit Server VM Zulu11.56+19-CA (build 11.0.15+10-LTS, mixed mode)

Here is a patch-package:

diff --git a/node_modules/@shopify/flash-list/android/build.gradle b/node_modules/@shopify/flash-list/android/build.gradle
index 0585d2a..f75cb04 100644
--- a/node_modules/@shopify/flash-list/android/build.gradle
+++ b/node_modules/@shopify/flash-list/android/build.gradle
@@ -44,8 +44,12 @@ android {
     }
 
     compileOptions {
-        sourceCompatibility JavaVersion.VERSION_1_8
-        targetCompatibility JavaVersion.VERSION_1_8
+      sourceCompatibility = JavaVersion.VERSION_11
+      targetCompatibility = JavaVersion.VERSION_11
+    }
+
+    kotlinOptions {
+      jvmTarget = JavaVersion.VERSION_11.toString()
     }
 
     sourceSets {

Dunno if this is right or wrong but project compiles and all my flashlist are working.

I'd love to know from expert what are the risks of forcing the usage of Java 11 though.

@Ghauoor
Copy link

Ghauoor commented Nov 26, 2024

Having the same issue...

@fynally
Copy link

fynally commented Jan 4, 2025

Why is this issue being totally ignored?.
Am getting the same error too

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

7 participants