I faced a slightly different problem, but I think the resolution could be the same.
The error I had was "class file major version 61", and after reading this, I understood I needed my project to compile with Java 11, and I think that will resolve your issue as well.
Steps to fix:
- Download java11 -
brew install openjdk@11
- Symlink it to your JVM folder - In the output of the above command, find "For the system Java wrappers to find this JDK, symlink it with " - run this command
- In
android/gradle.properties, add line org.gradle.java.home=/Library/Java/JavaVirtualMachines/openjdk-11.jdk/Contents/Home
The good thing here is that you aren't changing your java home value or anything so if you need java 1.8 for other projects that's fine, you're just telling this project to compile with 11