Skip to content

Build, Package Size, and Compatibility ​

This section covers common build and compatibility topics: APK size, ProGuard/shrinking, Android Studio version compatibility, and Chromebook support.

Reduce APK Size ​

Split APKs by ABI and screen density to reduce individual APK size. See the Android documentation Build Multiple APKs and configure splits in the module-level build.gradle.

Runtime Errors with shrink-code (minifyEnabled = true) ​

If you set minifyEnabled to true in the app build.gradle, add the required keep rules in proguard-rules.pro to avoid runtime errors.

Example (excerpt):

properties
-dontwarn com.foxit.sdk.**
-keep class com.foxit.sdk.**{ *;}

-dontwarn com.microsoft.rightsmanagement.**
-keep class com.microsoft.rightsmanagement.** { *;}

-dontwarn com.microsoft.aad.adal.**
-keep class com.microsoft.aad.adal.** { *;}

-dontwarn com.edmodo.cropper.**
-keep class com.edmodo.cropper.** { *;}

-dontwarn org.bouncycastle**
-keep class org.bouncycastle.** { *;}

Chromebook Support ​

Supported. Set the following on the application node in AndroidManifest.xml:

xml
android:name="com.foxit.uiextensions.FoxitApplication"

For a custom Application class, extend FoxitApplication.

Android Studio 3.2 (Older IDE) ​

If you still use Android Studio 3.2 and cannot upgrade, building demos may fail. Try:

  • Lower com.android.tools.build:gradle in the demo build.gradle to 3.3.3;
  • Set distributionUrl in gradle-wrapper.properties to the gradle-4.10.1-all.zip version.