Skip to content
This repository has been archived by the owner on Jun 16, 2023. It is now read-only.

refactor: migrate android to google ML Kit #3272

Merged
merged 7 commits into from
Jul 16, 2021

Conversation

seancheung
Copy link
Contributor

According to https://developers.google.com/ml-kit/migration "ML Kit for Firebase" has been replaced with "ML Kit".

This PR cleans up all the old Firebase library references in the Android code and migrates to the new ML Kit.

I've tested this on-device and it works without any problem.(The example does not work at the beginning).

Docs are partially updated.

For iOS migration, check this PR: #3241

@MateusAndrade
Copy link
Collaborator

MateusAndrade commented Jul 11, 2021

Hi @seancheung , thanks for your help! I noticed that the build step for android is broken ./gradlew check. Did you manage to run these commands locally without any problem, or build the example/project after adding these changes?

@seancheung
Copy link
Contributor Author

Hi @seancheung , thanks for your help! I noticed that the build step for android is broken ./gradlew check. Did you manage to run these commands locally without any problem, or build the example/project after adding these changes?

Yes, but it should be ./gradlew :app:check instead since it's a multi-module project. But I have no idea how it should be set in circleci config.

@seancheung
Copy link
Contributor Author

Hi @seancheung , thanks for your help! I noticed that the build step for android is broken ./gradlew check. Did you manage to run these commands locally without any problem, or build the example/project after adding these changes?

voilà~
seems like I forgot to migrate the general flavor part(which uses Google Mobile Vision) :P

docs/installation.md Outdated Show resolved Hide resolved
docs/installation.md Outdated Show resolved Hide resolved
@MateusAndrade
Copy link
Collaborator

MateusAndrade commented Jul 15, 2021

Just merged #3241 for iOS, please let me know if there is any problem with the main version.

@seancheung
Copy link
Contributor Author

Just merged #321 for iOS, please let me know if there is any problem with the main version.

Do you mean #3241 ?
Yes I already use it in my project. I didn't see a problem.

@MateusAndrade MateusAndrade merged commit f72289f into react-native-camera:master Jul 16, 2021
n1ru4l pushed a commit that referenced this pull request Jul 16, 2021
# [4.0.0](v3.44.3...v4.0.0) (2021-07-16)

### Features

* migrate android to google ML Kit ([#3272](#3272)) ([f72289f](f72289f))
* migrate to google ML Kit ([#3241](#3241)) [skip ci] ([670b973](670b973))

### BREAKING CHANGES

* migrate to Google ML Kit

* migrate to google ML Kit

* refactor: migrate android to google ML Kit

* refactor: migrate android general flavor to mlkit

* docs: update docs for MLKit

* docs: update installation doc

Co-authored-by: Mike Duminy <[email protected]>
Co-authored-by: Zhang Xuan <[email protected]>
@n1ru4l
Copy link
Collaborator

n1ru4l commented Jul 16, 2021

🎉 This PR is included in version 4.0.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Comment on lines +76 to +80
implementation "com.google.android.gms:play-services-mlkit-text-recognition:16.3.0"
generalImplementation "com.google.android.gms:play-services-mlkit-barcode-scanning:16.2.0"
generalImplementation "com.google.android.gms:play-services-mlkit-face-detection:16.2.0"
mlkitImplementation "com.google.mlkit:barcode-scanning:16.2.0"
mlkitImplementation "com.google.mlkit:face-detection:16.1.2"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is really unfortunate that they do not publish a "Bill of Materials" that handles all the disparate versioning, there appears to be no avoiding a different version for almost every part.
It might still be a good idea for a follow-on PR that allowed users to specify versions in gradle variables in an ext block like googlePlayServicesVisionVersion used to have, e.g. playServicesMLKitFaceDetectionVersion / mlKitFaceDetectionVersion etc etc

@@ -0,0 +1,67 @@
---
id: migrationv4

This comment was marked as resolved.

This comment was marked as resolved.

sidebar_label: 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](https://developers.google.com/ml-kit/migration)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typo: not version 3.x, version 4.x here

@mikehardy
Copy link

@seancheung I just successfully integrated v4 on android while using react-native-firebase for other things, and tested QR scanning feeding into a react-native-firebase dynamic link decode etc - everything worked ✨

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants