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

Using Java 14 #261

Open
Yaski opened this issue Aug 25, 2024 · 4 comments
Open

Using Java 14 #261

Yaski opened this issue Aug 25, 2024 · 4 comments

Comments

@Yaski
Copy link

Yaski commented Aug 25, 2024

I'm getting this error while build

        return switch (mediaError) {
               ^
  (use -source 14 or higher to enable switch expressions)
/node_modules/react-native-filament/android/src/main/java/com/margelo/filament/FilamentRecorder.java:76: error: switch rules are not supported in -source 8
            case MediaRecorder.MEDIA_RECORDER_ERROR_UNKNOWN -> "unknown";
                                                            ^
  (use -source 14 or higher to enable switch rules)
2 errors

I guess it is because in build.gradle there is Java 8 requirement:

compileOptions {
    sourceCompatibility JavaVersion.VERSION_1_8
    targetCompatibility JavaVersion.VERSION_1_8
  }
@hannojg
Copy link
Member

hannojg commented Aug 26, 2024

what is your react native, java, compile sdk version?

@Yaski
Copy link
Author

Yaski commented Aug 26, 2024

@hannojg
"react": "18.2.0"
"react-native": "0.71.2"
minSdkVersion = 24
compileSdkVersion = 33
targetSdkVersion = 33
kotlinVersion = "1.8.0"
com.android.tools.build:gradle:7.3.1"

@hannojg
Copy link
Member

hannojg commented Aug 26, 2024

And the Java version you're using?

@Yaski
Copy link
Author

Yaski commented Aug 26, 2024

JDK 17 Zulu

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants