Skip to content

Frequently Asked Questions

richardsimongreen edited this page Jan 22, 2021 · 35 revisions

Issues with okhttp3 Dependency

SDK v6.2.1 and below

IProov Android SDK depends indirectly on okhttp 3.8.1. All reported implementation issues related to okhttp at the time of writing this note, have been due to the use of okhttp 4.x. Therefore, using okhttp 3.x is generally the solution.

This can be achieved by downgrading the dependency that provides 4.x, by excluding okhttp package from that dependency or by a combination of both of these.

Please note that a 3.x version is not necessarily older than 4.x one.

We also recommend that you check the actual dependency tree, as gradle can potentially resolve dependencies differently to what you might assume.

If you still have issues while using okhttp 3.x:

with minSDK 21+

You might encounter a bug in Android 11 with error "Expected Android API level 21+ but was 29". It seems that okhttp versions lower than 3.13.0 are not affected by this bug, so if you find this error then you have a dependency that is probably forcing an affected version of okhttp. If that's the case you should use okhttp 3.14.7, as the bug was fixed in that version, or later.

with minSDK 19

Generally you should not find any issue if this is the case. If still you have an issue in this scenario, then it is likely that you have a dependency that is forcing a version of okhttp higher than 3.12.12. Nevertheless, if that's the case you will have minSDK 21 instead and your app would crash in API 19. Everything should work as expected once you fix it to be a truly minSDK 19 app.

SDK above v6.2.1

We are soon releasing a new version with an updated direct dependency and that brings our indirect dependency of okhttp3 up to 3.12.12 by default.

What is the size impact of the Android SDK?

We know that SDK size impact is an important factor, and we continue to do everything we can to pack iProov's advanced technologies into as small a payload as possible. We get asked this question quite a bit, and it's a hard one to answer.

The short answer: It depends. Approximately 500 KB in typical cases.

The long answer:

When assessing the size impact, a key aspect will be to consider how many (if any) dependencies are shared between the iProov SDK and your app.

The iProov Android SDK has the following dependency tree:

+--- io.socket:socket.io-client:0.9.0
|    \--- io.socket:engine.io-client:0.9.0
|         \--- com.squareup.okhttp3:okhttp:3.8.1
|              \--- com.squareup.okio:okio:1.13.0
+--- com.android.support:appcompat-v7:28.0.0
|    \--- (Dependency tree truncated)
+--- com.android.support:exifinterface:28.0.0
     \--- com.android.support:support-annotations:28.0.0

So if for example your app already uses OkHttp (or another library which depends on OkHttp, such as Retrofit), or the Support Libraries, or uses Jetifier to convert to AndroidX, it will cause a difference in the size impact that the SDK will have on your app.

In addition, app downloads from Google Play are compressed, which further reduces the SDK size impact.

Since the size impact of the iProov SDK depends heavily upon the configuration of your existing app, it is impossible to provide an accurate determination of size impact across all possible scenarios.

However, to provide a rough estimate, we followed the following procedure:

A. Produce a basic app with the iProov SDK included, and generate an APK

B. Modify the same app to remove the iProov SDK, and generate an APK

We then analyzed both SDKs using the built-in Android Studio tools, which showed that the addition of the iProov SDK added approximately 500 KB to the download size of the APK.

NOTE: This does not include the addition of the optional iProov Firebase module (not required by most customers). The Firebase module itself is extremely lightweight and just acts as a thin wrapper around Firebase, so almost the entire size impact of adding Firebase will come from Google's Firebase library itself.

These calculations were performed in February 2020 using Android Studio 3.5.3 and are correct as of iProov SDK 5.0.0.

Why is the camera preview so slow?

On some very low-end devices, the system performance is insufficient to provide a smooth iProov experience. We are always looking at optimizing the Android SDK experience on low-end devices.

You should also ensure you are not running the SDK with the Android Studio debugger attached as this has a significant performance impact. You should also check the Known Issues page

Does the SDK support AndroidX?

iProov Android SDK 6.0+ uses AndroidX, therefore if using the latest versions of the Android SDK, you must use AndroidX.

If you are still using Android Support Libraries, you must continue to use iProov Android SDK 5.x (deprecated). We would encourage you to move to AndroidX as soon as possible.

What is option.ui.activityCompatibilityRequestCode?

This option was introduced in SDK v5.2.3.

For most cases, leave this value as null (default).

In some cases, you might want the iProov Activity to be started using startActivityForResult() instead of startActivity(). Typically, this is because your Activity has launchMode="singleInstance" set in the manifest, due to a strange side-effect of how singleInstance Activities are handled in Android. Note: This is strongly discouraged by both Google and iProov!

If you must use singleInstance for whatever reason, then ensure that you pass your calling Activity as the context to IProov.launch() and set a value for options.ui.activityCompatibilityRequestCode, which will be the requestCode for the result. This allows you to identify (and ignore) the result from iProov (which is always zero) in onActivityResult() if you have already implemented it.

Clone this wiki locally