Troubleshooting guide · React Native · Expo · EAS Build
React Native & Expo Errors: Causes and Fixes
These are the React Native and Expo errors I see most often when fixing client apps, especially apps generated with AI tools. Each section starts with the exact error text, a short answer, and the steps I use to fix it.
By Muhammad Abdullah, full-stack, mobile and ai automation developer · Last reviewed
Error 01
“Unable to resolve module” in React Native / Expo
Unable to resolve module <name> from <file>Short answer
Metro, the React Native bundler, cannot find the file or package you imported. Install the missing package with npx expo install, check the import path and its exact letter case, then restart Metro with a cleared cache.
Error 02
“Project is incompatible with this version of Expo Go”
Project is incompatible with this version of Expo GoShort answer
Your project’s Expo SDK version and the Expo Go app on your phone don’t match. Upgrade the project to the SDK Expo Go supports, or stop depending on Expo Go and use a development build.
Error 03
Native module not found / “Native module cannot be null” in Expo
Invariant Violation: TurboModuleRegistry.getEnforcing(...): '<Module>' could not be foundShort answer
The library you installed contains custom native code that is not inside Expo Go or your current build. Create a development build that includes the native code, and rebuild every time you add a native library.
Error 04
EAS Build failed: “Gradle build failed with unknown error”
Gradle build failed with unknown error. See logs for the “Run gradlew” phaseShort answer
The real error is earlier in the build log. Open the “Run gradlew” phase, search for the first “FAILURE” or “error:” line, and fix that cause — most often mismatched package versions, a library that is incompatible with your SDK, or a broken config plugin.
Error 05
Android “Duplicate class … found in modules”
Execution failed for task ':app:checkReleaseDuplicateClasses'. Duplicate class … found in modules …Short answer
Two dependencies include the same Java/Kotlin classes. Find which libraries the error names, then update, remove or exclude one of them so only one copy is bundled.
Error 06
iOS “CocoaPods could not find compatible versions for pod”
CocoaPods could not find compatible versions for pod “<Name>”Short answer
Your local CocoaPods spec repo is outdated, or a library needs a higher iOS deployment target. Update the repo and reinstall pods; if that fails, raise the deployment target.
Error 07
“"main" has not been registered” in React Native / Expo
Invariant Violation: "main" has not been registeredShort answer
The app crashed before it could register its root component, or the entry point is misconfigured. Scroll up in the logs to the first red error — that is the real cause — and check the main field in package.json.
Error 08
“Text strings must be rendered within a <Text> component”
Text strings must be rendered within a <Text> componentShort answer
React Native only renders text inside <Text>. You have a bare string — often a stray character, or 0 from a condition like {count && <View />} — directly inside a <View>.
Error 09
“VirtualizedLists should never be nested inside plain ScrollViews”
VirtualizedLists should never be nested inside plain ScrollViews with the same orientationShort answer
A FlatList or SectionList is inside a ScrollView that scrolls the same way, which breaks list virtualization and performance. Remove the outer ScrollView and put the extra content in the list’s header or footer.
Error 10
Google Play: “must target at least API level …”
Your app currently targets API level X and must target at least API level YShort answer
Google Play requires new apps and updates to target a recent Android API level. Upgrade to an Expo SDK that targets it, or set targetSdkVersion with expo-build-properties, then build and upload a new version.
Error 11
Google Play: “Version code has already been used”
Version code X has already been used. Try another version code.Short answer
Every upload to Google Play needs a higher versionCode than any build uploaded before. Increment android.versionCode, or let EAS manage it automatically.
Error 12
Environment variables undefined in Expo / EAS builds
process.env.EXPO_PUBLIC_… is undefined in an EAS buildShort answer
Expo only inlines variables whose names start with EXPO_PUBLIC_, and your local .env is often not part of the cloud build. Use the prefix, reference variables directly, and define them in EAS environment variables.