Automatic Linking (Recommended)
React Native Date Picker supports automatic linking for React Native 0.60 and above. In most cases, no manual linking is required.Standard Installation
- Install the package:
- Install iOS dependencies (skip for Expo projects):
- Rebuild your project:
React Native < 0.60
For projects using React Native versions below 0.60, automatic linking is not available. You’ll need to link the package manually.Using react-native link
Manual Linking
If automatic linking fails or you’re experiencing issues, you can manually link the package.iOS Manual Linking
-
Open your project in Xcode (
ios/YourProject.xcworkspace) -
In the project navigator, right-click on
Libraries→Add Files to [Your Project] -
Navigate to
node_modules/react-native-date-picker/iosand addRNDatePicker.xcodeproj -
In your project’s target, go to
Build Phases→Link Binary With Libraries -
Add
libRNDatePicker.afrom theRNDatePicker.xcodeproj -
Clean and rebuild:
Android Manual Linking
1. Update android/settings.gradle
Add the following:
2. Update android/app/build.gradle
Add the dependency:
3. Update MainApplication.java
For React Native < 0.60, add the package to your application:
4. Rebuild
Troubleshooting
iOS Issues
”Library not found”
-
Ensure pods are installed:
-
Clean the build folder:
-
Open Xcode and clean the build folder (
Cmd + Shift + K) -
Rebuild:
“Module not found”
-
Verify the package is in
node_modules: -
Reinstall dependencies:
-
Reset Metro bundler cache:
Android Issues
”Could not resolve”
If you see dependency resolution errors:- Sync Gradle files in Android Studio
-
Clean the build:
-
Rebuild:
“Duplicate class found”
This may occur if the library is linked multiple times:-
For React Native >= 0.60, remove manual linking from
settings.gradleandbuild.gradle -
Clean and rebuild: