google_ml_kit_flutter icon indicating copy to clipboard operation
google_ml_kit_flutter copied to clipboard

Issue when using Google-ML-Kit and cloud_firestore at the same time.

Open zedaraf opened this issue 3 years ago • 1 comments

Hello,

I have developed an app where I am using Firebase cloud_firestore. Everything works perfectly fine there. However, when I add this plugin as a dependency into my pubspec.yaml file, I get an error throw, and somehow cloud_firestore calls stop working. I cannot read, write, get, update, etc... If I remove this Google-ML-Kit dependency, the error disappears and the cloud_firestore starts working properly again. This is clearly an issue of conflict when I add this dependency.

W/Firestore(31243): (24.2.0) [WriteStream]: (52b527) Stream closed with status: Status{code=INTERNAL, description=error in frame handler, cause=java.lang.NoSuchMethodError: No interface method getBuffer()Lokio/Buffer; in class Lokio/BufferedSource; or its super classes (declaration of 'okio.BufferedSource' appears in /data/app/~~GnTjWekepN__Y9yxp7K-Gw==/com.testing.med-l7rCUPuQGBoIig48wQiFdg==/base.apk!classes7.dex)
W/Firestore(31243): 	at io.grpc.okhttp.OkHttpClientTransport$ClientFrameHandler.data(OkHttpClientTransport.java:1144)
W/Firestore(31243): 	at io.grpc.okhttp.internal.framed.Http2$Reader.readData(Http2.java:234)
W/Firestore(31243): 	at io.grpc.okhttp.internal.framed.Http2$Reader.nextFrame(Http2.java:147)
W/Firestore(31243): 	at io.grpc.okhttp.OkHttpClientTransport$ClientFrameHandler.run(OkHttpClientTransport.java:1103)
W/Firestore(31243): 	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
W/Firestore(31243): 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
W/Firestore(31243): 	at java.lang.Thread.run(Thread.java:920)
W/Firestore(31243): }.

Again, the reason I didn't file this in the cloud_firestore repo is because the issue resolves when I remove this dependency.

zedaraf avatar Jun 29 '22 17:06 zedaraf

Hi guys, sorry for the delay. Thanks for using our plugin. @bharat-biradar and I have been maintaining this plugin, but sometimes we cannot provide all the support you need. Both of us are busy with school, work and family. We created this plugin as an open source project. We do not have an ETA for this fix, too busy with so many things, but you are welcome to fork our repo, fix whatever is broken and sent the PR. We will review PRs as soon as possible and release a new version.

It seems that the dependencies for cloud_firestore and this plugin collide at the native level. Feel free to fork our repo and send a PR with your fix. Contributions are always welcome.

fbernaly avatar Jul 22 '22 00:07 fbernaly

I'm also having this issue. Has anyone found/made any fixes?

nutchanon-c avatar Oct 30 '22 06:10 nutchanon-c

I'm also having this issue. Has anyone found/made any fixes?

You can use the standalone plug in for what you want to use instead of using this entire plug in.

zedaraf avatar Oct 30 '22 06:10 zedaraf

I will try that. If I were to use the text recognition plugin, do you recommend the V1 or V2?

nutchanon-c avatar Oct 31 '22 03:10 nutchanon-c

I will try that. If I were to use the text recognition plugin, do you recommend the V1 or V2?

I would of course always use the latest version. It introduces fixes and improvements over the previous version.

zedaraf avatar Oct 31 '22 04:10 zedaraf

Using the standalone fixes my issue. Thank you.

nutchanon-c avatar Nov 01 '22 02:11 nutchanon-c