Issue:
This article addresses a known issue which can result in Vivox initialization errors on Android-based devices when using ProGuard obfuscation. The initialization process may fail due to a change in internal libraries used by the Vivox SDK after a certain version, unless additional ProGuard exceptions are provided.
Environment:
Projects using R8/ProGuard and built using the Vivox SDK for Android, including those targeting Android-based platforms like Meta Quest. This issue affects the following Vivox versions:
- Vivox Unity v16: 16.5.0 or later.
- Vivox Unity v15: 15.1.250000-pre.1 or later.
- Vivox Unreal: 5.25.0.unr.0 or later.
- Vivox Core: 5.25.0 or later.
Cause:
In certain released versions of Vivox (see Environment above), a change to one of the internal libraries used by the SDK introduced a conflict with ProGuard's obfuscation process. Without specific exceptions for the com.unity.httplib.jni
namespace, ProGuard can inadvertently modify code required for proper initialization, leading to runtime errors.
Resolution:
While the Engineering team is working on a permanent fix for future releases of the Vivox SDK, this issue can be circumvented by adding the following rules to your ProGuard configuration file:
-keep class com.unity.httplib.jni.** { *; } -dontwarn com.unity.httplib.jni.**
These rules prevent ProGuard from obfuscating the necessary classes within the com.unity.httplib.jni
namespace, ensuring correct Vivox initialization.
Additional notes:
- These ProGuard rules are required in addition to any existing rules you might have for
com.vivox.sdk.jni.**
. Both sets of rules are essential for proper Vivox functionality when using ProGuard. - If you are still experiencing initialization issues after implementing these rules, please double check the syntax and placement of your rules within your ProGuard file. Incorrectly placed or formatted rules may still lead to problems. If problems persist, please contact Unity support for further assistance, providing details about your Vivox SDK version, build environment, and the complete ProGuard configuration file.