1. Home
  2. Docs
  3. CTH Directory Apps
  4. Installation
  5. Creating a new application

Creating a new application

Run npx react-native init YourProject to create new application ( replace YourProject with your app name )

npx react-native init YourProject

Run your React Native application

Run npx react-native run-ios  and npx react-native run-android inside your React Native project folder to make sure that everything is set up correctly.

npx react-native run-ios
npx react-native run-android

You should see your new app running in your iOS and Android emulator shortly.

For Android, please make sure that you have an Android emulator running or a device connected before running code.

Fix Android bugs

* What went wrong:
A problem occurred configuring project ':app'.
> SDK location not found. Define location with an ANDROID_SDK_ROOT environment variable or by setting the sdk.dir path in your project's local properties file at ‘/YOUR_APP_PATH/android/local.properties'.

SOLUTION: Create a local.properties file in android folder and setting the sdk.dir path: https://prnt.sc/rb6wrw

warn Failed to connect to development server using "adb reverse": spawnSync adb ENOENT

SOLUTION: Run source ~/.bash_profile command on macOS to load the config into your current shell. Verify that ANDROID_HOME has been added to your path by running echo $PATH.

So when you have iOS and Android app running now, let add CTH Directory apps code to your application.

Was this article helpful to you? Yes No 4