Skip to content

React Native RICOH THETA Demo Installation Guide for Windows

react-windows-header

Overview

This section covers the installation process for React Native on Windows 11 so that we can run the demo-react-native. Another section will cover the installation for macOS.

For this installation you will need to install Node.js if you haven't already.

There will be videos and links in the resource section for the installation of node.js on your computer. This article also covers how to build the theta-client and make it available to demo-react-native, as well as building the demo-react-native and running it on an Android emulator.

The results will be shown using the THETA X running the demo-react-native using the THETA API.

General Steps to run React Native Demo on Windows

  1. Build the theta-client and make it available to demo-react-native
  2. Build demo-react-native
  3. Test the demo-react-native build on THETA X with an emulator
  4. Test all demo features: List Files, Take Photo

Resources

Work Environment

Dell XPS 13 Details
CPU Intel(R) Core(TM) i7-10710U CPU @ 1.10GHz 1.61 GHz
RAM 16.0 GB
OS Windows 11 Home

RICOH THETA X running firmware 2.00.0

Requirements

Command Line Steps

First Command - Clone the Repo

with git clone https://github.com/ricohapi/theta-client.git

firstCommand

Second Command - Go into theta-client directory

with cd theta-client

secondCommand

Third Command - Build Gradlew

with ./gradlew publishToMavenLocal podPublishXCFramework but I have an Error, the problem is the SDK location is not found. My solution is to set the environment variable of the SDK.

thirdCommand

Steps to Fix for Gradle Build Failure

  1. Search for env

    envVarScrenshot

  2. Click on environmental variables

    pressOnEnv

  3. New User Variable and Type in the Variable name ANDROID_HOME and set the path C:\Users\UserName\AppData\Local\Android\Sdk

    androidHome

    By default the path to the SDK usually is C:\Users\UserName\AppData\Local\Android\Sdk , Copy the Path substituting for your UserName

    pathscreenshot

  4. Restart your terminal by closing and relaunching it before trying out the gradlew build command again

Command Line Steps Continued

Retry Third Command - Try the Build Gradlew command again ./gradlew publishToMavenLocal podPublishXCFramework

tryAgainScreenshot

Screenshot below shows its successful successScreenshot

Fourth Command - Set the environment variable of THETA_CLIENT

with the process shown above using the Windows Environment Variable Editor.

Variable Name : THETA_CLIENT

Variable Path : C:\Users\Erik Rodriguez\Projects\theta-client

Substitute the variable path for your local path to theta-client

userVar

Restart your terminal by closing and relaunching it

Check if it sucessfully set the variable with echo $Env:THETA_CLIENT it should return the path of the THETA_CLIENT variable if set correctly

correctPath

Fifth Command - Go into react-native directory

with cd react-native

cdReactNative

Sixth Command - run bash ./mkpackage.sh

and as it appears we have errors to fix

bashCommand

To fix the mkpackage error

You need to Convert your file to Unix format. This is one way to do it and there may be other ways.

  1. Open up the VSCode editor, install it if you don't have it

  2. Open the file called mkpackage.sh in the theta-client\react-native directory

  3. Convert the mkpackage.sh file CRLF to LF by clicking on the bottom right CRLF button and changing it to LF as shown

    convertFile

  4. Save the file by pressing ctrl-s and you should be good to go!

Retry Sixth Command - run bash ./mkpackage.sh

bashGood

Go into the demo-react-native folder as shown below from the root directory theta-client

cd demos
cd demo-react-native

cdIntoDemo

Install and Run Yarn

Seventh command - run yarn install

Once you are in theta-client\demos\demo-react-native run the following command yarn install

Note 1: May need to run Powershell in administrator mode if command isn't working

Note 2: May need to Install Node.js if your npm command isn't working which is shown in the Node.js section

if you dont have yarn downloaded on your computer already then you need to get it by running npm install --global yarn

errorYarn

npmYarnInstall

goodYarnInstall

Time to Run the Demo on Android

Now that we've sucesfully installed the required tools and setup. In the directory of theta-client\demos\demo-react-native use the command yarn run android to start your app in an Android emulator. Process shown in this Android Emulator Section to setup this emulator before running this command.

yarnRunAndroid

androidEmulator

Possible Error's During Guide

Error Solution
SDK location not found. Define location with sdk.dir in the local.properties file or with an ANDROID_HOME environment variable Fix for Gradle Build Failure
Yarn not Working Install Yarn
mkpackage.sh doesn't seem to work CRLF to LF

Comments