Common Errors
NOTE :
Before launching the app, ensure you have correctly set up the ADMIN LARAVEL and have added all
necessary data through the admin panel.
- Could not connect to development server
- Ensure Metro bundler is running :
- npx react-native start
- Restart the app :
- npx react-native run-android
- If using a real device, ensure both your PC and device are on the same network.
- Try running :
- adb reverse tcp:8081 tcp:8081
- react-native-reanimated : Reanimated 2 failed to create a worklet
- Ensure Reanimated is installed correctly :
- npm install react-native-reanimated
- Add the Reanimated plugin in babel.config.js:
- module.exports = { presets: ['module:metro-react-native-babel-preset'], plugins: ['react-native-reanimated/plugin'], };
- Restart Metro with :
- npx react-native start --reset-cache
- For more detailed information on Reanimated setup, refer to the official documentation: Click to open link
- react-native-maps: Map is blank on Android
- Add the Google Maps API key in AndroidManifest.xml:
- Ensure dependencies are installed:
- npm install react-native-maps
- For more detailed information on Reanimated setup, refer to the official documentation: Click to open link
- react-navigation: The action 'NAVIGATE' was not handled
- Ensure the navigator is correctly defined in App.js :
- For Example :
- If using nested navigators, ensure that the screen is inside the correct navigator.
- For more detailed information on Reanimated setup, refer to the official documentation: Click to open link
- react-native-image-picker: Image picker doesn't work
- Add the Google Maps API key in AndroidManifest.xml :
- Rebuild the app :
- For more detailed information on setting up react-native-image-picker, refer to the official documentation: Click to open link
- react-native-gesture-handler: GestureHandlerRootView is not used
- Wrap your app in GestureHandlerRootView :
- For Example :
- For more detailed information on `react-native-gesture-handler` setup, refer to the official documentation: Click to open link
- Android Gradle Plugin requires Java 17 to run
- Check the Java version :
- java -version
- If it's not Java 17, update it :
- brew install openjdk@17
- Set the Java environment :
- export JAVA_HOME=$(/usr/libexec/java_home -v 17)
- Peer Dependency Conflict Error
- Error : npm WARN [package] has unmet peer dependency [dependency]
- Fix : Manually install the required peer dependency
- npm install [dependency]@[version]
- Error : npm ERR! Could not resolve dependency
- Fix : Use --legacy-peer-deps to bypass conflicts.
- npm install --legacy-peer-deps
- Error : React Native is outdated, incompatible with current dependencies
- Fix : Upgrade React Native with:
- npx react-native upgrade
- Error : npm ERR! Missing or invalid node_modules
- Fix : Delete node_modules and package-lock.json, then reinstall.
- rm -rf node_modules package-lock.json
- npm install
- Error : npm ERR! Failed to build or install native modules
- Fix : Ensure Android Studio is installed and properly configured. Rebuild the app:
- npx react-native run-android
- Find deprecated package:
- npm WARN deprecated react-native-image-picker@0.0.0: This package is deprecated.
- Replace deprecated packages or update to newer versions.
- npm install react-native-image-crop-picker
- Reinstall dependencies:
- rm -rf node_modules package-lock.json
- npm install
- Error : npm ERR! React Native version mismatch
- Fix : React Native versions in package.json, then run:
- npm ERR! React Native version mismatch: React Native requires [version] but you're using [installed version].
- Error : npm ERR! React Native CLI is outdated
- Fix : Use npx instead of the global CLI:
- npx react-native run-android
Error Message :
Could not connect to development server
Possible Solutions :
Error Message :
Reanimated 2 failed to create a worklet, maybe you forgot to add Reanimated's babel plugin?
Possible Solutions :
Possible Solutions:
<meta-data
android:name="com.google.android.geo.API_KEY"
android:value="YOUR_API_KEY"/>
Error Message :
Found screens inside a NavigationContainer but GestureHandlerRootView is not used
Possible Solutions :
import { NavigationContainer } from '@react-navigation/native';
export default function App() {
return (
<NavigationContainer>
<Stack.Navigator>
Stack.Screen
name="Home"
component={HomeScreen} />
</Stack.Navigator>
</NavigationContainer>
);
}
Possible Solutions :
<uses-permission android:name="android.permission.CAMERA"/>
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
npx react-native run-android
Error Message :
Found screens inside a NavigationContainer but GestureHandlerRootView is not used
Possible Solutions :
import { GestureHandlerRootView } from 'react-native-gesture-handler';
export default function App() {
return (
<GestureHandlerRootView style={{ flex:
1 }}>
<NavigationContainer>
{/* Your screens
*/}
</NavigationContainer>
</GestureHandlerRootView>
);
}
Error Message :
Android Gradle plugin requires Java 17 to run. You are currently using Java <version>
Possible Solutions :
Possible Solutions :
- Task :app:bundleReleaseJsAndAssets FAILED
- Run the following command before building :
- npx react-native start --reset-cache
- Try cleaning and rebuilding:
- cd android && ./gradlew clean
- cd..
- npx react-native run-android --variant=release
- Keystore file not found for signing config release
- Ensure your keystore file is placed in android/app/.
- Check your android/app/build.gradle for :
- signingConfigs { release { storeFile file('release.keystore') storePassword 'your-password' keyAlias 'your-key-alias' keyPassword 'your-key-password' } }
- If missing, create a new keystore :
- keytool -genkey -v -keystore release.keystore -alias my-key-alias -keyalg RSA -keysize 2048 -validity 10000
- SDK location not found
- SDK location not found. Define location with sdk.dir in the local.properties file.
- Open android/local.properties and set the correct SDK path :
- sdk.dir=/Users/your-username/Library/Android/sdk (Mac)
- sdk.dir=C:\\Users\\your-username\\AppData\\Local\\Android\\Sdk (Windows)
- If missing, create the file and add the path manually.
- app-release.apk not found after build
- Ensure you have built the APK correctly :
- cd android && ./gradlew assembleRelease
- The APK will be located at :
- android/app/build/outputs/apk/release/app-release.apk
- Unable to resolve dependency for ':app@release/compileClasspath'
- Run :
- cd android && ./gradlew clean
- ./gradlew --refresh-dependencies
- Check if any library is missing in package.json and reinstall :
- npm install
- React Native Hermes: Release build fails
- If using Hermes, ensure it's enabled :
- Try :
- Execution failed for task ':app:mergeDexRelease'
- defaultConfig { multiDexEnabled true }
- Install Multidex :
- Rebuild the app :
- Could not determine the dependencies of task ':app:compileReleaseJavaWithJavac'
- Ensure JDK 17 is installed :
- If not Java 17, update it :
- Rebuild the app.
- minCompileSdk (31) is greater than compileSdkVersion (30)
- Update your android/build.gradle :
- Rebuild the project :
Error Message :
Task :app:bundleReleaseJsAndAssets FAILED
Possible Solutions :
Error Message :
Keystore file '/android/app/release.keystore' not found for signing config 'release'
Possible Solutions :
Error Message :
Possible Solutions :
Possible Solutions :
Possible Solutions :
Error Message :
error: no suitable constructor found
Possible Solutions :
enableHermes: true
cd android && ./gradlew clean
Error Message :
Execution failed for task ':app:mergeDexRelease'.
Possible Solutions :
npm install @react-native-community/multidex
cd android && ./gradlew clean
npx react-native run-android --variant=release
Possible Solutions :
java -version
export JAVA_HOME=$(/usr/libexec/java_home -v 17)
Error Message :
Android dependency 'androidx.core:core' has different version for the compile
Possible Solutions :
compileSdkVersion = 33
targetSdkVersion = 33
cd android && ./gradlew clean
npx react-native run-android --variant=release
General Fix for APK Issues
cd android
./gradlew clean
./gradlew assembleRelease
- Command PhaseScriptExecution failed with a nonzero exit code
- Run the following command to clean the build :
- If you're using CocoaPods, try :
- Restart Xcode and rebuild the app.
- Command CompileSwift failed
- Upgrade your Swift version :
- Ensure Build System is set to "New Build System" in Xcode.
- The linked framework 'React-Core' is missing
- Run :
- CocoaPods version mismatch
- Update CocoaPods :
- The APK will be located at :
- android/app/build/outputs/apk/release/app-release.apk
- Unable to upload IPA to TestFlight/App Store
- Upload using Transporter (Mac App Store) or run :
- Unable to upload IPA to TestFlight/App Store
- Ensure you have excluded arm64 for simulators in Xcode → Build Settings :
- Excluded Architectures → arm64 (for Debug builds).
- Remove arm64 exclusion for Release builds.
Possible Solutions :
cd ios
xcodebuild clean
cd ios
pod install --repo-update
Possible Solutions :
sudo xcode-select --switch /Applications/Xcode.app
Possible Solutions :
cd ios
pod install
Possible Solutions :
sudo gem install cocoapods
pod install --repo-update
Possible Solutions :
xcrun altool --upload-app -f app.ipa -t ios --apiKey YOUR_KEY --apiIssuer YOUR_ISSUER_ID
Possible Solutions :
General Fix for iOS Build Issues
cd android
pod install --repo-update
pod install --repo-update
cd ..
npx react-native run-ios