Bug 1428128 - Store omni.ja uncompressed when packaging via Gradle. r?nalexander draft
authorJan Henning <jh+bugzilla@buttercookie.de>
Thu, 04 Jan 2018 19:48:43 +0100
changeset 715789 b905e596718c6540b7d814ef3c05a5c9f28f999e
parent 715782 796c2051fa45c114028b9a68f8cd00f394d0230a
child 744893 174e25d6103b545ac21173fac82fb0e8a990dcd8
push id94267
push usermozilla@buttercookie.de
push dateThu, 04 Jan 2018 19:05:48 +0000
reviewersnalexander
bugs1428128
milestone59.0a1
Bug 1428128 - Store omni.ja uncompressed when packaging via Gradle. r?nalexander - We already do this when packaging conventionally via ./mach package - The omnijar is itself already a compressed archive, so no need to compress it again - Gecko (especially the GeckoJarReader) expects the file to be STORED within the APK, doing otherwise may cause read access to the omnijar to fail MozReview-Commit-ID: GcpeAehLe5h
mobile/android/app/build.gradle
--- a/mobile/android/app/build.gradle
+++ b/mobile/android/app/build.gradle
@@ -22,16 +22,22 @@ android {
         testApplicationId 'org.mozilla.roboexample.test'
         testInstrumentationRunner 'org.mozilla.gecko.FennecInstrumentationTestRunner'
         // Used by Robolectric based tests; see TestRunner.
         buildConfigField 'String', 'BUILD_DIR', "\"${project.buildDir}\""
 
         vectorDrawables.useSupportLibrary = true
     }
 
+    aaptOptions {
+        // The omnijar is already a compressed file itself and Gecko expects it to be
+        // STORED within the APK rather than DEFLATED.
+        noCompress 'ja'
+    }
+
     compileOptions {
         sourceCompatibility JavaVersion.VERSION_1_7
         targetCompatibility JavaVersion.VERSION_1_7
     }
 
     dexOptions {
         javaMaxHeapSize "2g"
         jumboMode = true