Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

java.lang.UnsupportedClassVersionError while integrating firebase performance library in react native app

I am trying to integrate the firebase performance library into my react native application. I am following the documentation at https://rnfirebase.io/perf/usage

I am getting java.lang.UnsupportedClassVersionError error after adding the below line to /android/build.gradle

classpath 'com.google.firebase:perf-plugin:1.4.1'

Following is the complete error message:

A problem occurred configuring project ':amazon-cognito-identity-js'.
> Failed to notify project evaluation listener.
   > java.lang.UnsupportedClassVersionError: com/google/firebase/perf/plugin/FirebasePerfPlugin has been compiled by a more recent version of the Java Runtime (class file version 55.0), this version of the Java Runtime only recognizes class file versions up to 52.0

Following is my gradle version:

distributionUrl=https\://services.gradle.org/distributions/gradle-6.9-all.zip

Following is the java version on my machine:

openjdk version "1.8.0_292"
OpenJDK Runtime Environment (AdoptOpenJDK)(build 1.8.0_292-b10)
OpenJDK 64-Bit Server VM (AdoptOpenJDK)(build 25.292-b10, mixed mode)

Any idea what the issue can be?

like image 251
Vikas Roy Avatar asked Mar 07 '26 19:03

Vikas Roy


1 Answers

I solved this by changing the JDK runtime from 1.8 to 11 in Settings > Build, Execution, Deployment > Build Tools > Gradle > Gradle JDK.

like image 74
Marco Zanetti Avatar answered Mar 09 '26 08:03

Marco Zanetti



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!