Status Update
Comments
ma...@gmail.com <ma...@gmail.com> #2
[Comment deleted]
ma...@gmail.com <ma...@gmail.com> #3
[Comment deleted]
ma...@gmail.com <ma...@gmail.com> #4
Also of note is the adb error when trying to install bad APK: INSTALL_FAILED_DEXOPT
ma...@gmail.com <ma...@gmail.com> #5
load dex files over 5Gb. -> load dex files over 5Mb.
pa...@google.com <pa...@google.com>
ch...@google.com <ch...@google.com>
ma...@gmail.com <ma...@gmail.com> #7
There is already an option in dx allowing to force generation of smaller dex files:
--set-max-idx-number=<value>
Unfortunately changing the default is not a solution since the linearAlloc limit can be reached at very different levels depending on the classes hierarchy and other criteria.
In addition for most applications, moving to multidex will only help to workaround the linearalloc limit for the installation. But the application will still crash against the same limit at execution. The only working use case where I know multidex can help with linearalloc is when the apk does not contains one application but distinct pieces running in separate process.
--set-max-idx-number=<value>
Unfortunately changing the default is not a solution since the linearAlloc limit can be reached at very different levels depending on the classes hierarchy and other criteria.
In addition for most applications, moving to multidex will only help to workaround the linearalloc limit for the installation. But the application will still crash against the same limit at execution. The only working use case where I know multidex can help with linearalloc is when the apk does not contains one application but distinct pieces running in separate process.
ch...@google.com <ch...@google.com>
ma...@gmail.com <ma...@gmail.com> #9
The option is not documented in --help because it was designed for testing and we're not capable of documenting a reliable way to use it as a workaround of the linearalloc limit.
The linearalloc limit is reached when loading classes. At install time dexopt is loading all classes contained in the dex so it's facing the limit immediately. At execution the limit may be reached after some delay dependending of the usage you have of the packaged classes. If you face it at install time but not at execution, this means you never trigger the loading of some classes. In a real application those never loaded classes should have been shrinked away manually or by Proguard. The exception is when there are different groups of classes in the dex files used in separate process.
About multidex library supported versions I've merged recently a change to try to be clearerhttps://android-review.googlesource.com/#/c/108023/
The summary is that the library should work down to API 4 (Donut), but below ICS applications will probably be hit by the linearalloc limit
The linearalloc limit is reached when loading classes. At install time dexopt is loading all classes contained in the dex so it's facing the limit immediately. At execution the limit may be reached after some delay dependending of the usage you have of the packaged classes. If you face it at install time but not at execution, this means you never trigger the loading of some classes. In a real application those never loaded classes should have been shrinked away manually or by Proguard. The exception is when there are different groups of classes in the dex files used in separate process.
About multidex library supported versions I've merged recently a change to try to be clearer
The summary is that the library should work down to API 4 (Donut), but below ICS applications will probably be hit by the linearalloc limit
Description
Version used: 23.2.0
Theme used: Theme.AppCompat.Light.NoActionBar and Theme.AppCompat.Dark.NoActionBar (Both with ThemeOverlay.AppCompat.Dark.ActionBar)
Devices/Android versions reproduced on: Samsung Galaxy SIII / Android 4.4.4 (possible others)
So I upgraded to 23.2.0 last night and code that was previously working no longer has any effect. The code is straight forward:
floatingActionButton.setBackgroundTintList(ColorStateList.valueOf(ContextCompat.getColor(getContext(), R.color.red_primary)));