Age-Gender_Estimation_TF-Android icon indicating copy to clipboard operation
Age-Gender_Estimation_TF-Android copied to clipboard

Manage TFlite and MediaPipe for different ABIs

Open VishV-Android opened this issue 1 year ago • 10 comments

I am creating an android app using TensorFlow and MediaPipe for Object Detection. But in some devices, I am getting ABIs crashes for some devices in the firebase and this problem I am facing after the release the app. Could you pls help to resolve this issue? Thanks in advance.

VishV-Android avatar May 20 '24 09:05 VishV-Android

TFLite and Mediapipe APIs are compiled for four ABI platforms, armeabi-v7a, arm64-v8a, x86 and x86-64 which cover most Android devices. Could you tell specifically, on which ABIs is the app crashing?

shubham0204 avatar May 20 '24 10:05 shubham0204

@shubham0204 I am getting crashes issues in the app production.

I am asking about is it necessary to use these abiFilters for supports 32-bit processor?

ndk { abiFilters 'armeabi-v7a', 'arm64-v8a', 'x86_64' ,'x86' }

check this and also you can check the stackTrace as well at the bottom.

Screenshot 2024-05-20 175114

VishV-Android avatar May 20 '24 12:05 VishV-Android

MLKit and TFLite docs do not suggest adding abiFilters to build.gradle, but there's no harm in adding them. Without adding them, Android / PlayStore assumes that the app is built for all four ABIs. If this is not the case with the app, users may face crashes as the native code will not be supported on their device. Hence, it would be great to add abiFilters to give the right directions to the Android OS and PlayStore

shubham0204 avatar May 20 '24 13:05 shubham0204

I have added abiFilters but still getting error of not found native code. How to manage this? And if user face crashes then how to handle it?

VishV-Android avatar May 21 '24 04:05 VishV-Android

Can you share the entire log trace here (of the native-code not found error)?

shubham0204 avatar May 21 '24 10:05 shubham0204

Here is the screenshot of play Console log trace.

Screenshot 2024-05-21 172333

VishV-Android avatar May 21 '24 11:05 VishV-Android

@shubham0204 did you checked this issue?

VishV-Android avatar Jun 03 '24 06:06 VishV-Android

I am still not able to understand the cause of the issue The best we can try is to update the TensorFlow dependencies if they're not the latest ones

shubham0204 avatar Jun 04 '24 02:06 shubham0204

Whenever you figured out this issue Kindly let me know. In addition, I have used latest TensorFlow dependencies for my project.

VishV-Android avatar Jun 04 '24 05:06 VishV-Android

@VishV-Android Which Mediapipe Task library are you using for object detection? Do let me know its version and artifact ID.

shubham0204 avatar Aug 25 '24 02:08 shubham0204