Member-only story

Convert React Native Android codebase from Kotlin to Java.

Ankit Maheshwari
4 min readJun 17, 2024

--

To initialize a React Native project with the Android codebase in Java instead of Kotlin, you need to follow a different approach since there is no direct template for this.

My articles are open for everyone; non-member readers can read the article by clicking this Friend link.

Here’s how you can set up your project manually:

Initialize a Project and Manually Convert to Java.

  1. Initialize a New React Native Project: Use the standard command to initialize a new React Native project. This will default to creating Kotlin files for the Android part.
npx react-native init MyProject

2. Manually Replace Kotlin with Java: After the project is initialized, you can manually replace the Kotlin files with Java files. Here’s how to do it:

  • Navigate to the android folder in your project.
  • Locate Kotlin files typically found in android/app/src/main/java/com/myproject.

--

--

Ankit Maheshwari
Ankit Maheshwari

Responses (1)