Skip to content

Commit 28295c3

Browse files
committed
Document Android setup and troubleshooting for bare RN app
1 parent e130686 commit 28295c3

1 file changed

Lines changed: 49 additions & 0 deletions

File tree

  • packages/react-native-sdk/dev/bare-rn

packages/react-native-sdk/dev/bare-rn/README.md

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,39 @@ sudo xcode-select -s /Applications/Xcode.app/Contents/Developer
2424
sudo xcodebuild -runFirstLaunch
2525
```
2626

27+
Prerequisites for Android:
28+
29+
- Android SDK installed (via Android Studio recommended).
30+
- Android SDK packages required by this project:
31+
- Android SDK Platform 36
32+
- Android SDK Build-Tools 36.0.0
33+
- Android SDK Platform-Tools (`adb`)
34+
- Android Emulator
35+
- At least one emulator (AVD) created, or a physical Android device connected.
36+
37+
Set Android environment variables (`~/.zshrc`):
38+
39+
```sh
40+
export ANDROID_HOME="$HOME/Library/Android/sdk"
41+
export ANDROID_SDK_ROOT="$ANDROID_HOME"
42+
export PATH="$PATH:$ANDROID_HOME/platform-tools:$ANDROID_HOME/emulator:$ANDROID_HOME/cmdline-tools/latest/bin"
43+
source ~/.zshrc
44+
```
45+
46+
Create `android/local.properties`:
47+
48+
```sh
49+
printf "sdk.dir=%s/Library/Android/sdk\n" "$HOME" > packages/react-native-sdk/dev/bare-rn/android/local.properties
50+
```
51+
52+
Sanity checks:
53+
54+
```sh
55+
adb --version
56+
emulator -list-avds
57+
npx react-native doctor
58+
```
59+
2760
From the repo root:
2861

2962
```sh
@@ -53,6 +86,22 @@ yarn ios
5386
yarn android
5487
```
5588

89+
If using a physical device:
90+
91+
```sh
92+
adb devices
93+
adb reverse tcp:8081 tcp:8081
94+
```
95+
96+
## Troubleshooting
97+
98+
- `/.../adb: No such file or directory`
99+
- `platform-tools` is missing or `ANDROID_HOME` / `PATH` is not set correctly.
100+
- `No emulators found as an output of emulator -list-avds`
101+
- Create an emulator in Android Studio Device Manager, or connect a physical device.
102+
- `SDK location not found ... android/local.properties`
103+
- Set `ANDROID_HOME` / `ANDROID_SDK_ROOT` and create `packages/react-native-sdk/dev/bare-rn/android/local.properties`.
104+
56105
## Notes
57106

58107
- This app calls `@reflag/react-native-sdk` directly (no Expo runtime).

0 commit comments

Comments
 (0)