I’m encountering an error when trying to launch my React Native CLI app on an Android emulator using the commands npm start followed by npm run android. The error message I’m seeing is as follows:
(node:9880) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please
use a userland alternative instead.
info A dev server is already running for this project on port 8081.
info Installing the app...
Starting a Gradle Daemon, 2 incompatible and 1 stopped Daemons could not be reused, use
--status for details
> Task :app:compileDebugKotlin
> Task :app:compileDebugKotlin FAILED
121 actionable tasks: 15 executed, 106 up-to-date
info ???? Tip: Make sure that you have set up your development environment correctly, by
running npx react-native doctor. To read more about doctor command visit:
https://github.com/react-native-community/cli/blob/main/packages/cli-
doctor/README.md#doctor
e: file:///C:/Projects/app-
enel1/AwesomeProject/android/app/src/main/java/com/awesomeproject/MainActivity.kt:18:13
Expecting member declaration
... (additional errors)
FAILURE: Build failed with an exception.
It appears that the error is related to Kotlin, but I intend to use Java for my React Native project. Strangely, I see a folder called C:Projectsapp-enel1AwesomeProjectandroid.gradlekotlin, which suggests Kotlin is being used. However, my backend will be developed in Java. Can someone help me understand what’s happening and how I can resolve this error? How can I confirm whether my React Native project is configured to use Kotlin or Java?
Thank you in advance for any assistance you can provide.