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.

Causes and step-by-step fix →

Error 02

“Project is incompatible with this version of Expo Go”

Project is incompatible with this version of Expo Go

Short 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.

Causes and step-by-step fix →

Error 03

Native module not found / “Native module cannot be null” in Expo

Invariant Violation: TurboModuleRegistry.getEnforcing(...): '<Module>' could not be found

Short 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.

Causes and step-by-step fix →

Error 04

EAS Build failed: “Gradle build failed with unknown error”

Gradle build failed with unknown error. See logs for the “Run gradlew” phase

Short 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.

Causes and step-by-step fix →

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.

Causes and step-by-step fix →

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.

Causes and step-by-step fix →

Error 07

“"main" has not been registered” in React Native / Expo

Invariant Violation: "main" has not been registered

Short 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.

Causes and step-by-step fix →

Error 08

“Text strings must be rendered within a <Text> component”

Text strings must be rendered within a <Text> component

Short 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>.

Causes and step-by-step fix →

Error 09

“VirtualizedLists should never be nested inside plain ScrollViews”

VirtualizedLists should never be nested inside plain ScrollViews with the same orientation

Short 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.

Causes and step-by-step fix →

Error 10

Google Play: “must target at least API level …”

Your app currently targets API level X and must target at least API level Y

Short 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.

Causes and step-by-step fix →

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.

Causes and step-by-step fix →

Error 12

Environment variables undefined in Expo / EAS builds

process.env.EXPO_PUBLIC_… is undefined in an EAS build

Short 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.

Causes and step-by-step fix →

Let’s talk about the next step

Have an idea, a stuck app, or a workflow toimprove?

Tell me what you are building, what is blocking you, and what a successful outcome looks like.