React Native Android Emulator - "could not compile settings file"

React Native Android Emulator - "could not compile settings file"

Post by: Niraj Dhungana

Posted on: Nov 12, 2021

#React Native# Expo# Android Studio

Recently I was trying to set up an android emulator to run my react native project. But when I try to run my project I am getting this error “could not compile settings file ”. It took me lots of time to figure out what was going wrong with my project.

Later I found out that the problem is not with my project the actual problem is with the Java version of my computer. BTW I am using Windows PC and bear react native cli to develop my app.

Previously I was using Expo cli and Android Emulator and it was working completely fine because while using expo we don’t need to set up java separately inside our system.

Here is how I set up Expo and Android Studio

watch video

But while working with bare react native cli we need to set up everything on our own. So, if you are getting this same error then I will recommend you guys to uninstall the Java JDK you already have.

And install the Java JDK LTS version. Currently while I am writing this post the LTS version is Java 11. After installing the Java JDK restart your PC so that it can recognize the JAVA_HOME path.

Also you need to set up environment variables like ANDROID_HOME and platform-tools path. If you don’t know how to do that then here is the post which can help you to set up your android environment variables.