Qualeams / Android-Face-Recognition-with-Deep-Learning-Library

Face Recognition library for Android devices is an Android library (module) which includes several face recognition methods.
Apache License 2.0
371 stars 135 forks source link

What breaks a compatibility for API level <21? #17

Open mkosik opened 6 years ago

mkosik commented 6 years ago

Why is minSdkVersion 21 (Android 5.0 Lollipop) please?

I checked what changed in API 21 and obvious suspects for me were:

When it comes to NDK Native APIs, I also checked what LOCAL_LDLIBS you utilize, but I haven't found any so recent that it would require API level 21.

I also checked dependencies and OpenCV should run on far lower APIs (however your linked OpenCV port has also minSdkVersion 21) and when it comes to Tensorflow, it's native libraries can run on API >= 14 device (only their demo that utilized camera2 API requires API >=21, as mentioned here https://github.com/tensorflow/tensorflow/tree/master/tensorflow/examples/android).

So why is the API >=21 required please?

sladomic commented 6 years ago

I don't know it anymore 100%, but initially we used API version 16. Then, when we tried to run TensorFlow on a device with Android version 4.4.2, the app crashed. We searched for solutions and found out the following:

  1. the TensorFlow libs have been compiled with Android NDK r10e (all developers used this version because version r11 had issues https://github.com/tensorflow/tensorflow/issues/1468)
  2. Google changed some linkings in NDK r10 so some users (including us) encountered issues when running in older Android versions (https://issuetracker.google.com/issues/37000040)
  3. At the time being Bazel only supported Android NDK r10e, so we couldn't even downgrade. But a downgrade would have caused potential issues on newer Android devices (see forum in 2.)

Probably now everything is fixed and you could try to decrease the minVersions. We don't build TensorFlow by ourselves anymore, but include it as an aar library. I don't know with which NDK version this library has been build, but it seems r12b is used now (https://github.com/tensorflow/tensorflow/blob/master/WORKSPACE)