Metro is already running or stuck on the wrong port
Metro is already running or stuck on the wrong port
npm run android or npm run dev prints an error like Metro is already running or the bundler serves from an unexpected port, causing the app to fail to connect.Solution:Android build fails after adding or changing a native dependency
Android build fails after adding or changing a native dependency
npm run android fails with a Gradle error after you added, removed, or upgraded a library that has native Android code.Solution:Run the clean build script
./gradlew clean, and then rebuilds:Device not detected by adb
Device not detected by adb
adb devices returns an empty list, or the device shows as unauthorized.Solution:Verify USB debugging is enabled
- Open Settings → About phone and tap Build number seven times to enable Developer Options.
- Open Settings → Developer options and turn on USB debugging.
- When prompted on the device screen, tap Allow to authorise your computer.
Check the USB connection mode
Gradle sync fails or SDK path is invalid
Gradle sync fails or SDK path is invalid
Open the android/ directory in Android Studio
<project-root>/android.Check the SDK path
Install required SDK packages
android/app/build.gradle.App behaves unexpectedly after a dependency change (cache issues)
App behaves unexpectedly after a dependency change (cache issues)
npm install or changing a dependency, the app exhibits stale behaviour — showing old screens, crashing on import, or failing to resolve a module — even though the source code looks correct.Solution:TypeScript errors or unexpected lint failures
TypeScript errors or unexpected lint failures
Review remaining errors manually
Missing environment variables — network requests all fail
Missing environment variables — network requests all fail
SERVER_ENDPOINT is not set.Solution:Add the SERVER_ENDPOINT variable
http://your-backend-host:port with your actual backend URL. When running on an Android emulator, 10.0.2.2 maps to your host machine’s localhost.