Skip to content

ojaynico/KotlinReactNativeApp

Repository files navigation

KotlinReactNativeApp

This is an example application a react native application written in kotlin using wrappers from:

https://github.com/ojaynico/ojaynico-kotlin-react-native

How to use this repo

  1. Clone the repository using the link provided below.

    https://github.com/ojaynico/KotlinReactNativeApp.git

  2. Change directory to the shared directory.

    cd KotlinReactNativeApp/shared

  3. Run the following command in the directory to generate a build of the project. These files are later referenced in index.js in the react native directory.

    gradle assemble

  4. Change directory to the project directory.

    cd KotlinReactNativeApp

  5. Run either of the following commands.

    yarn install OR npm install

  6. Run the application on your device using the commands below.

    react-native run-android for android

    react-native run-ios for ios

The app should look like below on your device:

NOTE:

  • Main files being used are index.js, package.json, build.gradle, shared.js inside build folder and App.kt with our app code.
  • build.gradle file has some manual setup when it comes to using resources. Files are copied during gradle assemble task.
  • We also delete package.json files in build folder after assembling the project because they show errors of duplicate package.json while running the app.