Getting started with tfjs in React Native

Sidhartha Mallick
1 min readJan 26, 2021

--

First of all, you are supposed to have Bare React Native Project created using create-react-native-app myapp or by using expo init myapp . Anyways, I would specifically ask you to avoid using Managed Workflow provided by expo.

Proceed to the next steps if the created app could be built without any erros.

  1. You will need to install Android NDK from inside Android Studio or Link .
  2. Add NDK_PATH to path variables.
  3. Follow the instructions provided in here . Except for React Native Async Storage.
  4. Use npm install react-native-community/async-storage or yarn install react-native-community/async-storage to install async-storage in your app.
  5. Do create metro.config.js as per the given specifications.
  6. Use these for Path Variables for Mac OS. Find similar for Linux or Windows.
export ANDROID_HOME=$HOME/Library/Android/sdk
export ANDROID_SDK_ROOT=$HOME/Library/Android/sdk
export ANDROID_NDK_HOME=$ANDROID_SDK_ROOT/ndk-bundle
export ANDROID_NDK_ROOT=$ANDROID_SDK_ROOT/ndk-bundle
export PATH=$PATH:$ANDROID_HOME/emulator
export PATH=$PATH:$ANDROID_HOME/tools
export PATH=$PATH:$ANDROID_HOME/tools/bin
export PATH=$PATH:$ANDROID_HOME/platform-tools
export PATH=$PATH:$ANDROID_HOME/build-tools/28.0.3

Use this code to test whether tensorflow is ready.

!! HAPPY CODING !!

--

--

Sidhartha Mallick
Sidhartha Mallick

Written by Sidhartha Mallick

building investorsync.in/, iOS@Gojek, Ex- Intern@BrowserStack

No responses yet