Question/Issue
When enabling R8 (or ProGuard) in an Android app that integrates the DoveRunner Widevine Android SDK or DoveRunner NCG Android SDK, an error occurs while loading the SDK. Are there any additional configurations required to resolve this issue?
Short Description
Android Studio provides the R8 compiler (which replaced ProGuard starting from Gradle 3.4.0) by default to shrink, obfuscate, and optimize application code and resources.
In order for the DoveRunner Widevine Android SDK and DoveRunner NCG Android SDK libraries to work correctly in an R8-enabled environment, specific keep rules must be added to the project’s proguard-rules.pro file.
Resolution
Add the following settings to the <module-dir>/proguard-rules.pro file of the project where the SDK is applied, depending on the SDK you are using.
DoveRunner Widevine Android SDK
# doverunner widevine
-keep class com.doverunner.** {*;}
# Media3 (ExoPlayer)
-keep class androidx.media3.** {*;}
# sqlcipher
-keep class net.sqlcipher.** {*;}DoveRunner NCG Android SDK
# doverunner ncg
-keep class com.doverunner.ncg.** {*;}
-keep class com.doverunner.ncg2.** {*;}
# Media3 (ExoPlayer)
-keep class androidx.media3.** {*;}
# sqlcipher
-keep class net.sqlcipher.** {*;}You can also verify these configurations in the sample projects included with each SDK.