Stay organized with collections
Save and categorize content based on your preferences.
On devices running Android 10 (API level 29) and higher you can tell the platform to run
embedded DEX code directly from your app's APK file. This option can help
prevent an attack if an attacker ever managed to tamper with the locally
compiled code on the device.
If you're using the Gradle build system, to enable this feature do the
following:
Set the android::useEmbeddedDex attribute to
true in the
<application>
element of your app's manifest file.
Set useLegacyPackaging to false in the
module-level build.gradle.kts file (build.gradle
file if you're using Groovy).
Kotlin
packagingOptions{dex{useLegacyPackaging=false}}
Groovy
packagingOptions{dex{useLegacyPackagingfalse}}
If you're using the Bazel build system, to enable this feature set the
android:useEmbeddedDex attribute to true in the <application> element of
your app's manifest file and leave DEX files uncompressed:
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2025-01-24 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-01-24 UTC."],[],[]]