Migrating from version 2.x/3.x to 4.x
Version 3.x of react-native-camera replaces MLKit for Firebase
(which has been deprecated) with Google MLKit
, allowing you to use advanced features such as text/face recognition without Firebase. You can learn more at MLKit
Required steps
Skip this if you need Firebase in your project
Remove Firebase project
Android
Remove the Firebase configuration file by deleting the google-services.json config file at
android/app/
.Replace the Google Services Gradle plugin classpath in
android/app/build.gradle
with the one for the Strict Version Matcher plugin:
buildscript {
dependencies {
// Add this line
- classpath 'com.google.gms:google-services:4.0.1' <-- you might want to use different version
+ classpath 'com.google.android.gms:strict-version-matcher-plugin:1.2.1'
}
}
- Replace the Google Services Gradle plugin in
android/build.gradle
with the Strict Version Matcher plugin:
- apply plugin: 'com.google.gms.google-services'
+ apply plugin: 'com.google.android.gms.strict-version-matcher-plugin'
- Remove meta fron
android/app/Manifest.xml
(MLKit use bundled models)
<application ...>
...
- <meta-data
- android:name="com.google.firebase.ml.vision.DEPENDENCIES"
- android:value="ocr" />
- <!-- To use multiple models, list all needed models: android:value="ocr, face, barcode" -->
</application>
iOS
Remove
GoogleService-Info.plist
from your projectRemove
pod 'Firebase/Core'
from your Podfile
1\3. Remove Firebase code from AppDelegate.m
-#import <Firebase.h> // <--- add this
...
\- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
- [FIRApp configure]; // <--- add this
...
}