Mobile Development – Common Errors & Fixes
When developing mobile applications for Android or iOS, encountering build errors is a regular part of the process. These errors can stem from SDK misconfigurations, dependency issues, or quirks in cross-platform libraries like React Native. Below is a list of common issues developers face, along with tested solutions.
1. Broken or Missing Build Tools (Android)
Error:
Build-tool 35.0.0 is missing AAPT at /.../build-tools/35.0.0/aapt
FAILURE: Build failed with an exception.
> Installed Build Tools revision 35.0.0 is corrupted. Remove and install again using the SDK Manager.Symptoms:
Gradle build fails almost immediately.
Compilation of Java sources (
:app:compileDebugJavaWithJavac) cannot proceed.Error points to a corrupted or incomplete installation of Build Tools.
Solution:
Open Android Studio.
Go to SDK Manager → SDK Tools.
Uncheck and re-check Android SDK Build-Tools 35.0.0, then click Apply to reinstall.
Alternatively, run:
sdkmanager --uninstall "build-tools;35.0.0" sdkmanager "build-tools;35.0.0"
2. expo run:android Fails – Emulator Not Detected
expo run:android Fails – Emulator Not DetectedError:
Likely Cause:
The Android Debug Bridge (ADB) cannot find a running emulator.
Emulator may not be initialized or started properly.
Solution:
Start Android Studio.
Go to Tools → Device Manager, then launch a virtual device.
Verify the emulator is listed using:
You should see a list like:
Note: If no devices are listed, try restarting ADB:
3. Path Handling Errors in react-native-libsodium (Windows)
react-native-libsodium (Windows)Error Symptoms:
Build fails due to invalid escape sequences (
\A,\b, etc.).Common when project paths include backslashes (e.g.,
D:\Application\...).
Root Cause:
CMake interprets \\ in Windows-style paths as escape sequences. This causes malformed paths when building native dependencies.
Solution:
Manually modify the CMakeLists.txt file in the react-native-libsodium dependency:
File Path:
Fix:
Add the following lines to convert NODE_MODULES_DIR into a valid CMake path:
Then replace references to NODE_MODULES_DIR with SAFE_NODE_MODULES_DIR. For example:
After saving the file: Clean and rebuild your Android project:
Recommended Tip:
Avoid placing your project in folders with capital letters or special characters (e.g., D:\Application\Xion) to reduce CMake path issues.
4. ADB Shows Duplicate or Ghost Devices
Symptoms:
Android Studio’s AVD only lists one emulator, but
adb devicesshows multiple.Build errors or confusion about which emulator is active.
Cause:
Stale ADB device entries from previously deleted or corrupted emulator instances.
Fix: Restart the ADB server:
If this doesn't resolve it:
Delete all unused emulators from Android Studio → Device Manager.
Recreate new AVDs to avoid misconfigured devices.
Extra Tips for Smooth Builds
Always use Node.js LTS versions for React Native projects (avoid experimental versions like v23).
Run
npx expo doctorornpx react-native doctorregularly to diagnose config issues.Keep your Expo CLI and dependencies up to date:
Still Stuck?
If you continue to encounter issues:
Run the command with
--verboseor--stacktraceto get detailed logs.
Last updated
Was this helpful?