6

I am building a mobile application using React-Native. I am now trying to run my application on Android Emulator. First, this is the continuation of this question. I installed the Android Studio and configured the environment as I mentioned in the previous question.

This is what I did to fix the error from previous question.

I changed the line 13 in android/gradle.properties to this:

org.gradle.jvmargs=-Xmx2048m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8

When I run "react-native run-android" command this time, I am getting the error. The error is saying it could not find '/Users/waihein/Desktop/Code/shar-kya-mal-app/node_modules/@react-native-community/cli-platform-android/native_modules.gradle' file.

So I run npm i @react-native-community/cli-platform-android command to install the required package.

The I delete node_modules folder and run "npm install" again. Then I run "react-native run-android". I am getting the following error this time.

* Where:
Settings file '/Users/waihein/Desktop/Code/shar-kya-mal-app/android/settings.gradle' line: 8

* What went wrong:
A problem occurred evaluating settings 'sharkyamalapp'.
> Could not open dsl generic class cache for script '/Users/waihein/Desktop/Code/shar-kya-mal-app/node_modules/@react-native-community/cli-platform-android/native_modules.gradle' (/Users/waihein/.gradle/caches/6.8/scripts/a43tr593rdpk11ispliu0nu14).
   > BUG! exception in phase 'semantic analysis' in source unit '_BuildScript_' Unsupported class file major version 61

But the file is there I can see it in the node_modules folder. How can I fix it?

halfer
  • 19,824
  • 17
  • 99
  • 186
Wai Yan Hein
  • 13,651
  • 35
  • 180
  • 372

0 Answers0