cmd
console.
If you are on Windows, please consider (re-)running them in:
- emulated Git BASH shell (if you are using [Git for Windows])
- [PowerShell]
- [WSL] (if you are on Windows 10+)
See [Setting up the development environment].
npm
(v. 6.14.15
). So please make sure you have an up-to-date one.
Check with:
npm --version
expected output example:
8.14.0
To update run:
npm install -g npm@latest
See [Downloading and installing Node.js and npm] for more info.
npm remove jewelry-ar-react-native-sdk
npm install "https://pi-ar-sdk-public.storage.googleapis.com/jewelry-ar-react-native-sdk-$(curl https://pi-ar-sdk-public.storage.googleapis.com/_latest_tar.txt).tgz"
cd ios
pod install --repo-update
❓ If you get and error like
Invalid `Podfile` file: cannot load such file
➡️ try
cd ..
npm audit fix
cd ios
pod update
The steps mentioned below are supposed to enable the autonomy of debug builds:
-
By default, React Native relies on Metro to bundle and transfer the files from development machine onto device via WiFi in run time.
-
On iOS, Metro is automatically started when the application is run in Debug scheme from Xcode, so the steps below might be unnecessary.
-
When built with Release scheme, the files get properly bundled into the final IPA/APK, so the steps below are unnecessary.
-
For running to Android with Debug scheme from Android Studio, the steps below are usually necessary.
Otherwise, the JS bundle in the resulting application archive/bundle will be outdated (or not exist at all).
Also, non-existence of main.jsbundle
might cause a compilation failure of Debug scheme on iOS.
android
/ios
!!!
mkdir -p android/app/src/main/assets/
mkdir -p android/app/src/main/res/
npx react-native bundle --platform android --entry-file index.js --bundle-output android/app/src/main/assets/index.android.bundle --assets-dest android/app/src/main/res/
If the command fails, check whether the destination paths exist in the filesystem.
mkdir -p ios/SampleApp/index
npx react-native bundle --entry-file index.js --bundle-output ios/SampleApp/index/main.jsbundle --platform ios
If the command fails, check whether the destination paths exist in the filesystem.
See React Native documentation on running the first app:
See [Running On Device].