While running `pod install` in a React Native iOS project, you may suddenly encounter `[!] Unable to find a specification for RNWorklets depended upon by RNReanimated`. This error typically appears after upgrading React Native, installing React Navigation, or updating React Native Reanimated. Although React Native code generation completes successfully, CocoaPods fails because it cannot resolve the native Worklets dependency required by newer versions of Reanimated.
The Error
What Causes This Error
Newer versions of React Native Reanimated depend on Worklets. During pod installation, CocoaPods tries to resolve the `RNWorklets` pod. If the Worklets package is missing, incompatible, or the dependencies are corrupted, pod installation fails before the iOS project can build successfully.
- `react-native-worklets` package is missing
- Reanimated and Worklets versions are incompatible
- Corrupted node_modules directory
- Stale Pods or Podfile.lock files
- Incomplete dependency installation
- Upgrading React Native without upgrading Reanimated dependencies
- Mixing Reanimated 3.x and 4.x packages
Fix 1: Check Installed Versions
Before making changes, verify which version of Reanimated is installed and whether Worklets exists in your project.
Fix 2: Install React Native Worklets
Reanimated 4.x and newer versions require Worklets. Installing the package resolves the missing pod dependency.
Fix 3: Delete Pods and Reinstall
Outdated pod metadata can prevent CocoaPods from resolving dependencies correctly. Delete Pods and regenerate them from scratch.
Fix 4: Reinstall Node Modules
If dependencies are corrupted, removing node_modules and reinstalling packages can restore missing references.
Fix 5: Verify Reanimated Compatibility
Different Reanimated versions have different requirements. Reanimated 4.x requires Worklets, while Reanimated 3.x does not.
Fix 6: Update CocoaPods Repository
Older CocoaPods repositories may contain outdated pod specifications. Updating the local repository ensures CocoaPods has access to the latest pod metadata.
Fix 7: Reinstall React Native Reanimated
If Worklets and Reanimated versions are incompatible, reinstalling Reanimated can resolve dependency mismatches.
Example Failure Log
Quick Diagnosis Checklist
- Verify the installed Reanimated version
- Check whether `react-native-worklets` is installed
- Delete Pods and Podfile.lock
- Run `pod install --repo-update`
- Remove and reinstall node_modules
- Ensure Reanimated and Worklets versions are compatible
- Update CocoaPods repository
- Rebuild the app after successful pod installation
FAQ
Why does pod install fail with RNWorklets?
Because React Native Reanimated depends on Worklets, and CocoaPods cannot find or resolve the RNWorklets pod.
Do I need react-native-worklets?
Yes. Reanimated 4.x and newer versions require the react-native-worklets package.
Can deleting Pods solve this issue?
Yes. Removing Pods and Podfile.lock often fixes stale dependency metadata and allows CocoaPods to regenerate dependencies correctly.
Is this a React Navigation problem?
No. The issue originates from React Native Reanimated and its native Worklets dependency rather than React Navigation.
Why does code generation succeed but pod install fail?
React Native Codegen runs before CocoaPods resolves native dependencies. Code generation can complete successfully while pod installation later fails when CocoaPods cannot locate RNWorklets.