I\'m working on MacOS and just starting with react-native
.
One of the first steps to get started is to run: react-native run-android
or
I was getting this error, but for a more recent version of Java - 10.0.2.
To fix my error, I followed the steps mentioned by @Blacktoviche
in this Github issue: https://github.com/facebook/react-native/issues/17688
When I opened the android
folder inside my project via Android Studio, I was prompted with Android Gradle plugin update recommended
. At the time, I was following a slightly outdated tutorial that told me to click Don't remind me again for this project
.
However, as @Blacktoviche
recommended in the github issue linked above, sometimes it's necessary to update the Gradle plugin. After updating, I also had to click Install Build Tools 27... and sync project
(I don't remember the exact version).
After I followed these steps, I was able to successfully run my react native app on the Android Studio emulator.
Hope this helps someone!