This guide helps users migrate from older versions of react-native-biometric-login to version 2.0.22+ which includes Swift bridging header fixes and React Native 0.81.0+ compatibility.
- Before: Compatible with React Native 0.70.0+
- After: Requires React Native 0.81.0+
- Before: Worked with both static and dynamic frameworks
- After: Requires dynamic frameworks for Swift bridging header compatibility
Ensure your project uses React Native 0.81.0+:
# Check current version
npx react-native --version
# Update if needed (follow React Native upgrade guide)
npx react-native upgrade# Using yarn (recommended)
yarn add react-native-biometric-login@latest
# Using npm
npm install react-native-biometric-login@latestUpdate your ios/Podfile:
# BEFORE (Old configuration)
use_frameworks! :linkage => :static
# AFTER (New configuration)
use_frameworks! :linkage => :dynamicIf you must keep static frameworks:
# Keep static frameworks by default
use_frameworks! :linkage => :static
# Add post-install hook to make BiometricLogin dynamic
post_install do |installer|
installer.pods_project.targets.each do |target|
if target.name == 'BiometricLogin'
target.build_configurations.each do |config|
config.build_settings['MACH_O_TYPE'] = 'mh_dylib'
config.build_settings['BUILD_LIBRARY_FOR_DISTRIBUTION'] = 'YES'
config.build_settings['DEFINES_MODULE'] = 'YES'
config.build_settings['SWIFT_INSTALL_OBJC_HEADER'] = 'YES'
end
end
end
endcd ios
rm -rf Pods Podfile.lock build
pod installEnsure your Android project has the React Native Gradle Plugin:
// android/settings.gradle
apply from: file("../node_modules/@react-native/gradle-plugin/settings.gradle")// android/app/build.gradle
apply from: file("../../node_modules/@react-native/gradle-plugin/libs/react.gradle")Firebase projects typically used:
use_frameworks! :linkage => :static
$RNFirebaseAsStaticFramework = trueUpdate to:
use_frameworks! :linkage => :dynamic
$RNFirebaseAsStaticFramework = trueFirebase will handle its own static linkage internally while allowing other frameworks to be dynamic.
Cause: Still using static frameworks Solution: Switch to dynamic frameworks as shown above
Cause: Missing React Native Gradle Plugin Solution: Add the plugin configuration shown in Step 5
Cause: Framework linkage conflicts Solution: Use the Firebase configuration shown above
- Clean build:
cd ios && xcodebuild clean - Install pods:
pod install - Build project in Xcode
- Clean build:
cd android && ./gradlew clean - Rebuild:
./gradlew assembleDebug
If migration causes issues, you can temporarily rollback:
# Install previous version
yarn add react-native-biometric-login@2.0.21
# Revert Podfile changes
# Revert Android configuration changesNote: Rolling back will lose the Swift bridging header fixes and React Native 0.81.0+ compatibility.
If you encounter migration issues:
- Check the Swift Bridging Header Troubleshooting Guide
- Review the Main Troubleshooting Guide
- Open an issue with your error logs and environment details
- ✅ Swift bridging header compatibility fixes
- ✅ React Native 0.81.0+ support
- ✅ Improved Firebase compatibility
- ✅ Better error handling and debugging
- ✅ Enhanced TypeScript definitions
- ✅ TurboModule architecture improvements
- Immediate: Update library and iOS configuration
- Short-term: Test thoroughly in development
- Long-term: Plan for React Native 0.81.0+ upgrade if not already done