Hi Team
How do i resolve this issue below, i am creating a react-native using VS code and want to use React-Native CLI. But when i ran the command on the terminal npx react-native run-android/start it crashes this below error.
// Error on the terminal.
FAILURE: Build failed with an exception.
* What went wrong:
Could not open settings generic class cache for settings file 'C:\React_Apps\React_Developments\eCommerce\android\settings.gradle' (C:\Users\Zux\.gradle\caches\7.5.1\scripts\5rpxaq3rgq1fbs19q6t5wlamv).
> BUG! exception in phase 'semantic analysis' in source unit '_BuildScript_' Unsupported class file major version 63
* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
Tuhin PaulPosted Feb 16, 2023, 12:03 PM
Thanks for posting the question.
The Gradle build system used by React Native is unable to open a class cache for your project because of an unsupported class file version that you may be using. You may need to update the Gradle version to support the class file version.
Please follow the step as I am sharing below:
1. You have to open the android/build.gradle file of your project.
2. Next, Locate the following line:
3. Next, Replace this version 3.6.3 with the latest Gradle version. You can find the latest Gradle version at this link: https://gradle.org/releases/.
For example, you can use:
4. Save the file and close it.
5. Open the terminal and run the following commands in your project directory:
6. This should start the build process again and should resolve the issue. If the problem persists, try running the command with the --stacktrace option to get more information about the error.
Keep one thing in mind that you may need to update the gradle-wrapper.properties file located in the android/ directory if the version is not compatible with the latest Gradle version.