I have problems in installing signed release version of my app on Android Wear. Some say it's because of Asset Compression.
How can I disable Asset Compression in gradle in android studio?
Step 1: To create an asset folder in Android studio open your project in Android mode first as shown in the below image. Step 2: Go to the app > right-click > New > Folder > Asset Folder and create the asset folder. Step 3: Android Studio will open a dialog box.
in launcher's build.gradle, locate aaptOptions.noCompress, add files which don't need to be compressed there. Then build the apk, you can then open that apk with tool like 7-zip, and check the compression method next to target file, it should be called "Store" instead of "Deflate"
In this article, you will learn how to resize and compress an image in Android. Resizing and compressing an image is sometimes very useful. Right-click on "layout" then select "New" -> "Layout resource file". Name this file as "splash_layout" and add the following code to it: Right-click on the package then select "New" -> "Java class".
This process can greatly reduce your app's size if, for example, your app includes many library dependencies but utilizes only a small part of their functionality. To shrink your app’s code, R8 first determines all entry points into your app’s code based on the combined set of configuration files .
You can disable AAPT compression for given filetypes via an aaptOptions
block in the android
block of your build script:
android {
...
aaptOptions {
noCompress 'png'
}
}
Having said that, it seems unlikely that disabling asset compression will solve your problem; the build system in most cases ought to be able to build a compatible app without resorting to arcane options. If turning off compression doesn't help, you can modify your question or ask a new one.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With