peterferguson / react-native-passkeys

67 stars 10 forks source link

Support for Expo 51 / RN 0.74 #14

Closed anudit closed 1 week ago

anudit commented 1 month ago

When I try and compile for Expo 51, I run into the following error

[RUN_GRADLEW] FAILURE: Build failed with an exception.
[RUN_GRADLEW] * What went wrong:
[RUN_GRADLEW] Execution failed for task ':react-native-passkeys:compileDebugKotlin'.
[RUN_GRADLEW] > Inconsistent JVM-target compatibility detected for tasks 'compileDebugJavaWithJavac' (17) and 'compileDebugKotlin' (20).
[RUN_GRADLEW]
[RUN_GRADLEW]   Consider using JVM Toolchain: https://kotl.in/gradle/jvm/toolchain
[RUN_GRADLEW]   Learn more about JVM-target validation: https://kotl.in/gradle/jvm/target-validation
[RUN_GRADLEW] * Try:
[RUN_GRADLEW] > Run with --stacktrace option to get the stack trace.
[RUN_GRADLEW] > Run with --info or --debug option to get more log output.
[RUN_GRADLEW] > Run with --scan to get full insights.
[RUN_GRADLEW] > Get more help at https://help.gradle.org.
[RUN_GRADLEW] BUILD FAILED in 41s
[RUN_GRADLEW] Error: Gradle build failed with unknown error. See logs for the "Run gradlew" phase for more information.

Build failed
Gradle build failed with unknown error. See logs for the "Run gradlew" phase for more information.
npx exited with non-zero code: 1
    Error: build command failed.

Repro

bunx create-expo-app
bunx expo install react-native-passkeys
eas build
peterferguson commented 1 month ago

Hey I am not actually using android yet in my current projects so I haven't come across this.

@andrew-levy Has implemented the android side of this lib so maybe you have come across this in some of projects?

mariushorvat commented 1 month ago

I'm getting the same error in Android. Do you guys think this it may be some sort of issue with React Native 0.74.x and JAVA 17?

"expo": "51.0.0",
"react-native": "0.74.2",
* What went wrong:
Execution failed for task ':expo-application:compileDebugKotlin'.
> Inconsistent JVM-target compatibility detected for tasks 'compileDebugJavaWithJavac' (17) and 'compileDebugKotlin' (11).

  Consider using JVM Toolchain: https://kotl.in/gradle/jvm/toolchain
  Learn more about JVM-target validation: https://kotl.in/gradle/jvm/target-validation 
andrew-levy commented 1 month ago

My guess is that the instances of Java 11 need to be replaced with 17 in this file https://github.com/peterferguson/react-native-passkeys/blob/main/android/build.gradle

Are you able to make that change locally and try building again?

ashtar23 commented 3 weeks ago

Hey @andrew-levy , I just gave it a go and did the changes locally. Seems like that did it, thanks a bunch!

Not sure if it's a good idea to create PR to address this?

peterferguson commented 3 weeks ago

@anudit

Sure PRs are welcome 👍