This repository has been archived by the owner on Apr 25, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 56
MultiDEX project
Alexander Yakushev edited this page Jul 23, 2015
·
2 revisions
At some point during the development you may see the following (or similar) exception:
trouble writing output: Too many field references: 68805; max is 65536. You may try using --multi-dex option. References by package: 3 android 2 android.accounts 31 android.app ...
or
Conversion to Dalvik format failed: Unable to execute dex: method ID not in [0, 0xffff]: 65536
This means that you’ve hit the 65k method limit which is imposed by DEX format. It usually happens after you add a few big (or many small) dependencies to your project. In order to make your project build again perform these steps:
- In
project.clj
add the following lines to:android
map::multi-dex true :multi-dex-proguard-conf-path "build/proguard-multi-dex.cfg"
- The file
build/proguard-multi-dex.cfg
should already be in your project folder if you created the project recently. Otherwise you can copy it from here. - Remove “incremental” from
:dex-opts
option in:android
map. Multidexing and incremental dexing are unfortunately incompatible. - Make sure that you use the latest Neko version, and your application class is
set to
neko.App
inAndroidManifest.template.xml
.After you do these steps and rebuild your project, lein-droid will package classes into several DEX files. Multidexing build is somewhat slower but it is the only option to overcome the 65k limit.
Tutorial
- Installation
- Creating a new project
- Quick start
- Libraries and dependencies
- Editors and IDEs
- Troubleshooting
Profiles
Lean compilation
Multi-DEX project
Creating AAR libraries
Hacking the plugin
project.clj options
-
:android
- :aot
- :aot-exclude-ns
- :assets-paths
- :build-tools-version
- :build-type
- :dex-opts
- :external-classes-paths
- :external-res-paths
- :force-dex-optimize
- :ignore-log-priority
- :key-alias
- :keypass
- :keystore-path
- :lean-compile
- :library
- :manifest-options
- :manifest-template-path
- :multi-dex
- :multi-dex-proguard-conf-path
- :native-libraries-paths
- :proguard-execute
- :proguard-conf-path
- :rename-manifest-package
- :repl-device-port
- :repl-local-port
- :res-path
- :resource-jars-paths
- :sdk-path
- :sigalg
- :skummet-skip-vars
- :start-nrepl-server
- :storepass
- :target-version
- :use-debug-keystore
- :dependencies
- :java-only
- :profiles
- *warn-on-reflection*